From 08b6f61798fc5b2f0f0fdcaa8e4f52ad58f29623 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 11 Sep 2023 16:45:46 -0700 Subject: [PATCH 0001/1168] [release/v7.4.0-preview.6] Harden some problematic release tests (#20155) (#20254) --- .../Get-ChildItem.Tests.ps1 | 32 +++++++--- .../ConstrainedLanguageModules.Tests.ps1 | 32 ++++++++-- .../ConstrainedLanguageRestriction.Tests.ps1 | 60 ++++++++----------- .../PackageManagement.Tests.ps1 | 12 +++- .../engine/Module/ModulePath.Tests.ps1 | 2 +- 5 files changed, 89 insertions(+), 49 deletions(-) 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 42c8a3e8bf6..4c7fdfa5294 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 @@ -226,14 +226,29 @@ Describe "Get-ChildItem" -Tags "CI" { } It 'Works with Windows volume paths' -Skip:(!$IsWindows) { - $volume = (Get-Volume -DriveLetter $env:SystemDrive[0]).Path - $items = Get-ChildItem -LiteralPath "${volume}Windows" - Write-Verbose -Verbose "Trying files in '${volume}Windows'" - if (-not $items) { + $winPath = $env:windir + if (! $winPath) { + Set-ItResult -Skipped -Because "windir is null" + return + } + + $driveLetter = $winPath[0] + $winPartialPath = $winPath.SubString(3) # skip the drive letter, colon, and backslash + Write-Verbose -Verbose "Partial path is '$winPartialPath'" + $volume = (Get-Volume -DriveLetter $driveLetter).Path + if (! $volume) { + Set-ItResult -Skipped -Because "Get-Volume returned no volume for system drive '$driveLetter'" + return + } + + $items = Get-ChildItem -LiteralPath "${volume}${winPartialPath}" + Write-Verbose -Verbose "Trying files in '${volume}${winPartialPath}'" + if ($items.Count -eq 0) { Write-Verbose -Verbose "`$items is null!!" } - $items[0].Parent | Should -BeExactly "${volume}Windows" - $items | Should -HaveCount (Get-ChildItem $env:SystemRoot).Count + + $items[0].Parent.FullName | Should -BeExactly "${volume}${winPartialPath}" + $items | Should -HaveCount (Get-ChildItem $winPath).Count } It 'Works with Windows pipes' -Skip:(!$IsWindows) { @@ -294,7 +309,10 @@ Describe 'FileSystem Provider Formatting' -Tag "CI","RequireAdminOnWindows" { if ($IsWindows) { - $testcases += @{ expectedMode = "l----"; expectedModeWithoutHardlink = "l----"; itemType = "Junction"; itemName = "Junction-Directory"; fileAttributes = [System.IO.FileAttributes]::Directory -bor [System.IO.FileAttributes]::ReparsePoint; target = $targetDir1.FullName } + # arm64 adds the archive attribute + $junctionMode = (Test-IsWindowsArm64) ? "la---" : "l----" + $armFileAttributes = (Test-IsWindowsArm64) ? [System.IO.FileAttributes]"Directory,Archive,ReparsePoint" : [System.IO.FileAttributes]"Directory,ReparsePoint" + $testcases += @{ expectedMode = $junctionMode; expectedModeWithoutHardlink = $junctionMode; itemType = "Junction"; itemName = "Junction-Directory"; fileAttributes = $armFileAttributes; target = $targetDir1.FullName } $testcases += @{ expectedMode = "-a---"; expectedModeWithoutHardlink = "-a---"; itemType = "File"; itemName = "ArchiveFile"; fileAttributes = [System.IO.FileAttributes] "Archive"; target = $null } $testcases += @{ expectedMode = "la---"; expectedModeWithoutHardlink = "la---"; itemType = "SymbolicLink"; itemName = "SymbolicLink-File"; fileAttributes = [System.IO.FileAttributes]::Archive -bor [System.IO.FileAttributes]::ReparsePoint; target = $targetFile1.FullName } $testcases += @{ expectedMode = "la---"; expectedModeWithoutHardlink = "-a---"; itemType = "HardLink"; itemName = "HardLink"; fileAttributes = [System.IO.FileAttributes] "Archive"; target = $targetFile2.FullName } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageModules.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageModules.Tests.ps1 index 926be123d41..8c1333769dd 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageModules.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageModules.Tests.ps1 @@ -622,6 +622,10 @@ try Describe "Import mix of trusted and untrusted manifest and module files" -Tags 'Feature','RequireAdminOnWindows' { It "Verifies that an untrusted manifest with a trusted module will not load under system lockdown" { + if (Test-IsWindowsArm64) { + Set-ItResult -Pending -Because "https://github.com/PowerShell/PowerShell/issues/20169" + return + } $manifestFileName = Join-Path $TestDrive "ImportUnTrustedManifestWithFnExport.psd1" $moduleFileName = Join-Path $TestDrive "ImportUnTrustedManifestWithFnExport_System32.psm1" @@ -642,8 +646,8 @@ try try { - $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage" Invoke-LanguageModeTestingSupportCmdlet -SetLockdownMode + $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage" Import-Module -Name $manifestFileName -Force -ErrorAction Stop throw "No Exception!" @@ -704,6 +708,10 @@ try } It "Verifies that an untrusted module with nested trusted modules cannot load in a locked down system" { + if (Test-IsWindowsArm64) { + Set-ItResult -Pending -Because "https://github.com/PowerShell/PowerShell/issues/20169" + return + } $manifestFileName = Join-Path $TestDrive "ImportUnTrustedManifestWithTrustedModule.psd1" $moduleFileName = Join-Path $TestDrive "ImportUnTrustedManifestWithTrustedModule_System32.psm1" @@ -723,8 +731,8 @@ try try { - $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage" Invoke-LanguageModeTestingSupportCmdlet -SetLockdownMode + $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage" Import-Module -Name $manifestFileName -Force -ErrorAction Stop throw "No Exception!" @@ -742,6 +750,10 @@ try } It "Verifies that an untrusted manifest containing all trusted modules does not load under system lock down" { + if (Test-IsWindowsArm64) { + Set-ItResult -Pending -Because "https://github.com/PowerShell/PowerShell/issues/20169" + return + } $moduleFileName1 = Join-Path $TestDrive "ImportUnTrustedManifestWithTrustedModules1_System32.psm1" $moduleFileName2 = Join-Path $TestDrive "ImportUnTrustedManifestWithTrustedModules2_System32.psm1" @@ -768,8 +780,8 @@ try try { - $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage" Invoke-LanguageModeTestingSupportCmdlet -SetLockdownMode + $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage" Import-Module -Name $manifestFileName -Force -ErrorAction Stop throw "No Exception!" @@ -1313,6 +1325,10 @@ try } It "Verifies that importing untrusted manifest in lock down mode exports all functions by default" { + if (Test-IsWindowsArm64) { + Set-ItResult -Pending -Because "https://github.com/PowerShell/PowerShell/issues/20169" + return + } CreateManifestNames "ImportUntrustedManifestWithNoFnExport" @' @@ -1330,8 +1346,8 @@ try try { - $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage" Invoke-LanguageModeTestingSupportCmdlet -SetLockdownMode + $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage" $module = Import-Module -Name $manifestFileName -Force -PassThru } finally @@ -1376,6 +1392,10 @@ try } It "Verifies that importing untrusted module file in lock down mode exports all functions by default" { + if (Test-IsWindowsArm64) { + Set-ItResult -Pending -Because "https://github.com/PowerShell/PowerShell/issues/20169" + return + } CreateManifestNames "ImportUnTrustedModuleWithNoFnExport" @' @@ -1534,6 +1554,10 @@ try } It "New-Module succeeds in creating module with untrusted scriptblock in ConstrainedLanguage" { + if (Test-IsWindowsArm64) { + Set-ItResult -Pending -Because "https://github.com/PowerShell/PowerShell/issues/20169" + return + } $result = $null diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 index 72faa923f1e..acd5a45939e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 @@ -966,12 +966,17 @@ try } It "Verifies a scriptblock from a trusted script file does not run as trusted" { + if (Test-IsWindowsArm64) { + Set-ItResult -Pending -Because "https://github.com/PowerShell/PowerShell/issues/20169" + return + } $result = $null try { Invoke-LanguageModeTestingSupportCmdlet -SetLockdownMode + # Wait for the lockdown mode to take effect $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage" # Import untrusted module @@ -1027,6 +1032,7 @@ try Import-Module -Name $scriptModulePath -Force + $result1 = ModuleFn $result2 = ImportModuleFn } @@ -1046,9 +1052,7 @@ try $randomClassName = "class_$(Get-Random -Max 9999)" - $script = @' - class {0} {{ static Hello([string] $msg) {{ [System.Console]::WriteLine("Hello from: $msg") }} }} -'@ -f $randomClassName + $script = "class ${randomClassName} { static [string] GetLanguageMode() { return (Get-Variable -ValueOnly -Name ExecutionContext).SessionState.LanguageMode } }" $modulePathName = "modulePath_$(Get-Random -Max 9999)" $modulePath = Join-Path $testdrive $modulePathName @@ -1097,46 +1101,34 @@ try It "Verifies that classes cannot be created in script files running under constrained language" { - try - { - Invoke-LanguageModeTestingSupportCmdlet -SetLockdownMode - $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage" - - & ($untrustedScriptFile) - throw "No Error!" + try { + $ps = [powershell]::Create("NewRunspace") + $ps.Runspace.LanguageMode = "ConstrainedLanguage" + $result = $ps.AddScript($untrustedScriptFile).Invoke() + $ps.Streams.Error[0].FullyQualifiedErrorId | Should -BeExactly "ClassesNotAllowedInConstrainedLanguage" -Because "Invoke-Command should fail in constrained language" } - catch - { - $expectedError = $_ + catch { + $_ | Should -BeNullOrEmpty -Because "exception '$_' unexpected." } - finally - { - Invoke-LanguageModeTestingSupportCmdlet -EnableFullLanguageMode -RevertLockdownMode + finally { + $ps.Dispose() } - - $expectedError.FullyQualifiedErrorId | Should -BeExactly "ClassesNotAllowedInConstrainedLanguage" } It "Verifies that classes cannot be created in untrusted script modules running under constrained language" { - - try - { - Invoke-LanguageModeTestingSupportCmdlet -SetLockdownMode - $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage" - - Import-Module -Name $untrustedScriptModule -ErrorAction Stop - throw "No Error!" + try { + $ps = [powershell]::Create("NewRunspace") + $ps.Runspace.LanguageMode = "ConstrainedLanguage" + # importing the module whilst in constrained language makes it untrusted, even without lockdown mode + $ps.AddCommand("Import-Module").AddParameter("Name", $untrustedScriptModule).Invoke() + $ps.Streams.Error[0].FullyQualifiedErrorId | Should -BeExactly "ClassesNotAllowedInConstrainedLanguage" -Because "Import-Module should fail in constrained language" } - catch - { - $expectedError = $_ + catch { + $_ | Should -BeNullOrEmpty -Because "exception '$_' unexpected." } - finally - { - Invoke-LanguageModeTestingSupportCmdlet -EnableFullLanguageMode -RevertLockdownMode + finally { + $ps.Dispose() } - - $expectedError.FullyQualifiedErrorId | Should -BeExactly "ClassesNotAllowedInConstrainedLanguage" } It "Verifies that classes can be created in trusted script files running under constrained language" { diff --git a/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 b/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 index e6fdb981f15..0eaeaa03e68 100644 --- a/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 +++ b/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 @@ -67,9 +67,15 @@ Describe "PackageManagement Acceptance Test" -Tags "Feature" { AfterAll { $ProgressPreference = $SavedProgressPreference - Unregister-PackageSource -Source $localSourceName -ErrorAction Ignore - Unregister-PackageSource -Name $gallerySourceName -ErrorAction Ignore - Uninstall-Module NanoServerPackage -ErrorAction Ignore -WarningAction SilentlyContinue + try { + # non-fatal errors + Unregister-PackageSource -Source $localSourceName -ErrorAction Ignore + Unregister-PackageSource -Name $gallerySourceName -ErrorAction Ignore + Uninstall-Module NanoServerPackage -ErrorAction Ignore -WarningAction SilentlyContinue + } + catch { + Write-Warning "Failure in AfterAll: $_" + } } It "get-packageprovider" { diff --git a/test/powershell/engine/Module/ModulePath.Tests.ps1 b/test/powershell/engine/Module/ModulePath.Tests.ps1 index 5bf3b4e4c89..5861455e726 100644 --- a/test/powershell/engine/Module/ModulePath.Tests.ps1 +++ b/test/powershell/engine/Module/ModulePath.Tests.ps1 @@ -180,7 +180,7 @@ Describe "SxS Module Path Basic Tests" -tags "CI" { try { $userConfig = '{ "PSModulePath": "myUserPath" }' Set-Content -Path $userConfigPath -Value $userConfig -Force - $out = & $powershell -noprofile -command 'powershell.exe -noprofile -command $env:PSModulePath' + $out = & $powershell -noprofile -command 'powershell.exe -noprofile -command `$env:PSModulePath' $out | Should -Not -BeLike 'myUserPath;*' } finally { From 67310dfc2a95e596a347400ec87606b7e7d05140 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 11 Sep 2023 16:50:09 -0700 Subject: [PATCH 0002/1168] [release/v7.4.0-preview.6] Skip the test on x86 as `InstallDate` is not visible on `Wow64` (#20165) (#20255) --- .../Get-ComputerInfo.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 824de391020..8d68a2aaafc 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ComputerInfo.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ComputerInfo.Tests.ps1 @@ -232,9 +232,9 @@ function Get-PropertyNamesForComputerInfoTest "WindowsVersion", "WindowsUBR") - if ([System.Management.Automation.Platform]::IsIoT) + if ([System.Management.Automation.Platform]::IsIoT -or (Test-IsWinWow64)) { - Write-Verbose -Verbose -Message "WindowsInstallDateFromRegistry is not supported on IoT." + Write-Verbose -Verbose -Message "WindowsInstallDateFromRegistry is not supported on current platform." } else { From 5ba9159454d18cd1c852f390ff76674a70848fee Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 11 Sep 2023 17:17:53 -0700 Subject: [PATCH 0003/1168] [release/v7.4.0-preview.6] Fix typo `donet` to `dotnet` in build scripts and pipelines (#20122) (#20256) --- build.psm1 | 4 ++-- .../azureDevOps/templates/compliance/apiscan.yml | 4 ++-- .../azureDevOps/templates/linux-packaging.yml | 4 ++-- tools/releaseBuild/azureDevOps/templates/linux.yml | 4 ++-- .../azureDevOps/templates/mac-package-build.yml | 8 ++++---- tools/releaseBuild/azureDevOps/templates/mac.yml | 8 ++++---- tools/releaseBuild/azureDevOps/templates/nuget.yml | 4 ++-- .../azureDevOps/templates/release-GlobalToolTest.yml | 12 ++++++------ .../azureDevOps/templates/release-SDKTests.yml | 8 ++++---- .../templates/release-ValidateFxdPackage.yml | 4 ++-- .../azureDevOps/templates/testartifacts.yml | 8 ++++---- .../azureDevOps/templates/windows-hosted-build.yml | 4 ++-- .../azureDevOps/templates/windows-packaging.yml | 4 ++-- 13 files changed, 38 insertions(+), 38 deletions(-) diff --git a/build.psm1 b/build.psm1 index d08124e8a86..a226bde5349 100644 --- a/build.psm1 +++ b/build.psm1 @@ -19,8 +19,8 @@ $script:Options = $null $dotnetMetadata = Get-Content $PSScriptRoot/DotnetRuntimeMetadata.json | ConvertFrom-Json $dotnetCLIChannel = $dotnetMetadata.Sdk.Channel $dotnetCLIQuality = $dotnetMetadata.Sdk.Quality -$dotnetAzureFeed = if (-not $env:__DONET_RUNTIME_FEED ) { $dotnetMetadata.Sdk.azureFeed } -$dotnetAzureFeedSecret = $env:__DONET_RUNTIME_FEED_KEY +$dotnetAzureFeed = if (-not $env:__DOTNET_RUNTIME_FEED ) { $dotnetMetadata.Sdk.azureFeed } +$dotnetAzureFeedSecret = $env:__DOTNET_RUNTIME_FEED_KEY $dotnetSDKVersionOveride = $dotnetMetadata.Sdk.sdkImageOverride $dotnetCLIRequiredVersion = $(Get-Content $PSScriptRoot/global.json | ConvertFrom-Json).Sdk.Version diff --git a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml index 207bdf0d297..bf631b3acc1 100644 --- a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml +++ b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml @@ -40,8 +40,8 @@ jobs: retryCountOnTaskFailure: 2 displayName: 'Bootstrap' env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | Import-Module .\build.psm1 -force diff --git a/tools/releaseBuild/azureDevOps/templates/linux-packaging.yml b/tools/releaseBuild/azureDevOps/templates/linux-packaging.yml index 928832376fa..4439ded9f26 100644 --- a/tools/releaseBuild/azureDevOps/templates/linux-packaging.yml +++ b/tools/releaseBuild/azureDevOps/templates/linux-packaging.yml @@ -253,8 +253,8 @@ jobs: condition: and(succeeded(), ne(variables['SkipBuild'], 'true')) workingDirectory: $(PowerShellRoot) env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - powershell: | try { diff --git a/tools/releaseBuild/azureDevOps/templates/linux.yml b/tools/releaseBuild/azureDevOps/templates/linux.yml index 6d1d3b83fa6..a65045ce323 100644 --- a/tools/releaseBuild/azureDevOps/templates/linux.yml +++ b/tools/releaseBuild/azureDevOps/templates/linux.yml @@ -62,8 +62,8 @@ jobs: condition: and(succeeded(), ne(variables['SkipBuild'], 'true')) workingDirectory: $(PowerShellRoot) env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | try { diff --git a/tools/releaseBuild/azureDevOps/templates/mac-package-build.yml b/tools/releaseBuild/azureDevOps/templates/mac-package-build.yml index cce35c61e95..f3801deaa9e 100644 --- a/tools/releaseBuild/azureDevOps/templates/mac-package-build.yml +++ b/tools/releaseBuild/azureDevOps/templates/mac-package-build.yml @@ -119,8 +119,8 @@ jobs: } displayName: 'Bootstrap VM' env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | # Add -SkipReleaseChecks as a mitigation to unblock release. @@ -133,8 +133,8 @@ jobs: } displayName: 'Package' env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 displayName: 'Component Detection' diff --git a/tools/releaseBuild/azureDevOps/templates/mac.yml b/tools/releaseBuild/azureDevOps/templates/mac.yml index 7bf1a2121df..f13c00ef421 100644 --- a/tools/releaseBuild/azureDevOps/templates/mac.yml +++ b/tools/releaseBuild/azureDevOps/templates/mac.yml @@ -43,8 +43,8 @@ jobs: tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 -location $(PowerShellRoot) -BootStrap displayName: 'Bootstrap VM' env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - template: /tools/releaseBuild/azureDevOps/templates/insert-nuget-config-azfeed.yml parameters: @@ -58,8 +58,8 @@ jobs: $env:AzDevOpsFeedPAT2 = $null displayName: 'Build' env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 displayName: 'Component Detection' diff --git a/tools/releaseBuild/azureDevOps/templates/nuget.yml b/tools/releaseBuild/azureDevOps/templates/nuget.yml index eee32ed82c6..749956682d3 100644 --- a/tools/releaseBuild/azureDevOps/templates/nuget.yml +++ b/tools/releaseBuild/azureDevOps/templates/nuget.yml @@ -60,8 +60,8 @@ jobs: Start-PSBootStrap -Verbose displayName: Bootstrap env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - task: DownloadBuildArtifacts@0 displayName: 'Download PowerShell build artifacts - finalResults' diff --git a/tools/releaseBuild/azureDevOps/templates/release-GlobalToolTest.yml b/tools/releaseBuild/azureDevOps/templates/release-GlobalToolTest.yml index bd353baaec8..cc6af2d8526 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-GlobalToolTest.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-GlobalToolTest.yml @@ -61,8 +61,8 @@ jobs: displayName: Install .NET env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | $branch = $ENV:BUILD_SOURCEBRANCH @@ -85,8 +85,8 @@ jobs: displayName: Install global tool env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | $toolPath = "$(System.DefaultWorkingDirectory)/toolPath/${{ parameters.globalToolExeName }}" @@ -148,5 +148,5 @@ jobs: } displayName: Basic validation env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) diff --git a/tools/releaseBuild/azureDevOps/templates/release-SDKTests.yml b/tools/releaseBuild/azureDevOps/templates/release-SDKTests.yml index 45f15074702..2279c3325e1 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-SDKTests.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-SDKTests.yml @@ -97,8 +97,8 @@ jobs: displayName: Install .NET env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 @@ -136,8 +136,8 @@ jobs: displayName: Restore and execute tests env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - task: PublishTestResults@2 displayName: 'Publish Test Results **\test-hosting.xml' diff --git a/tools/releaseBuild/azureDevOps/templates/release-ValidateFxdPackage.yml b/tools/releaseBuild/azureDevOps/templates/release-ValidateFxdPackage.yml index 6843cf2a2dd..1aa88af9143 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-ValidateFxdPackage.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-ValidateFxdPackage.yml @@ -38,8 +38,8 @@ jobs: Write-Verbose -Message "Installing .NET SDK completed." -Verbose displayName: Install .NET env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | Get-ChildItem -Path '$(Pipeline.Workspace)/releasePipeline/finalResults' -Recurse diff --git a/tools/releaseBuild/azureDevOps/templates/testartifacts.yml b/tools/releaseBuild/azureDevOps/templates/testartifacts.yml index b7080936757..09f5c5bce5d 100644 --- a/tools/releaseBuild/azureDevOps/templates/testartifacts.yml +++ b/tools/releaseBuild/azureDevOps/templates/testartifacts.yml @@ -25,8 +25,8 @@ jobs: Start-PSBootstrap displayName: Bootstrap env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | Import-Module ./build.psm1 @@ -86,8 +86,8 @@ jobs: Start-PSBootstrap displayName: Bootstrap env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | Import-Module ./build.psm1 diff --git a/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml b/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml index 539992c63ce..b533061178f 100644 --- a/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml +++ b/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml @@ -66,8 +66,8 @@ jobs: tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 -location '$(PowerShellRoot)' -destination '$(Build.ArtifactStagingDirectory)/Symbols_$(Architecture)' -Runtime $runtime -ReleaseTag '$(ReleaseTagVar)' -Symbols @params displayName: 'Build Windows Universal - $(Architecture)-$(BuildConfiguration) Symbols zip' env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | $packageName = (Get-ChildItem '$(Build.ArtifactStagingDirectory)\Symbols_$(Architecture)').FullName diff --git a/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml b/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml index ffc3225e387..91a5c15f112 100644 --- a/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml +++ b/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml @@ -259,8 +259,8 @@ jobs: $(PowerShellRoot)/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 -BuildZip $signedPkg -location '$(PowerShellRoot)' -destination '$(System.ArtifactsDirectory)\pkgSigned' -Runtime $runtime -ReleaseTag '$(ReleaseTagVar)' @params displayName: 'Build Windows Universal - $(Architecture) Package' env: - __DONET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) - __DONET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | Get-ChildItem '$(System.ArtifactsDirectory)\pkgSigned' | ForEach-Object { From d9620c7bcebd088ec4b5d4a44ea2b59a17db88d6 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 11 Sep 2023 17:19:05 -0700 Subject: [PATCH 0004/1168] [release/v7.4.0-preview.6] Add mariner arm64 to PMC release (#20176) (#20257) --- tools/packages.microsoft.com/mapping.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/packages.microsoft.com/mapping.json b/tools/packages.microsoft.com/mapping.json index a1ea93f4e03..48e93bba724 100644 --- a/tools/packages.microsoft.com/mapping.json +++ b/tools/packages.microsoft.com/mapping.json @@ -36,6 +36,14 @@ "PackageFormat": "PACKAGE_NAME-POWERSHELL_RELEASE-1.cm.x86_64.rpm", "channel": "stable" }, + { + "url": "cbl-mariner-2.0-preview-Microsoft-aarch64", + "distribution": [ + "bionic" + ], + "PackageFormat": "PACKAGE_NAME-POWERSHELL_RELEASE-1.cm.aarch64.rpm", + "channel": "preview" + }, { "url": "cbl-mariner-2.0-preview-Microsoft-x86_64", "distribution": [ From 648461a336b0c00ae9f1d124a95ca605b276f169 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 11 Sep 2023 17:21:19 -0700 Subject: [PATCH 0005/1168] [release/v7.4.0-preview.6] Start using new packages.microsoft.com cli (#20141) (#20258) --- .../azureDevOps/releasePipeline.yml | 18 ++++++++- .../release-PublishPackageMsftCom.yml | 40 ++++++++++++++++--- .../templates/release-ReleaseToNuGet.yml | 9 +++++ 3 files changed, 60 insertions(+), 7 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/releasePipeline.yml b/tools/releaseBuild/azureDevOps/releasePipeline.yml index 51117ca99de..5ca465a74f1 100644 --- a/tools/releaseBuild/azureDevOps/releasePipeline.yml +++ b/tools/releaseBuild/azureDevOps/releasePipeline.yml @@ -1,9 +1,19 @@ trigger: none # needed to disable CI trigger and allow manual trigger -# when the branch is same as pipline source, the latest build from the source is used. +# when the branch is same as pipeline source, the latest build from the source is used. # all environment used are for manual tasks and approvals. +parameters: + - name: skipPackagesMsftComPublish + displayName: Skip actual publishing to Packages.microsoft.com, AFTER we upload it. Used to test the publishing script. + default: false + type: boolean + - name: skipNugetPublish + displayName: Skip nuget publishing. Used in testing publishing stage. + default: false + type: boolean + resources: pipelines: - pipeline: releasePipeline @@ -17,7 +27,7 @@ resources: type: git trigger: none name: Internal-PowerShellTeam-Tools - ref: master + ref: main-mirror variables: - name: runCodesignValidationInjection @@ -340,6 +350,8 @@ stages: steps: - template: templates/release-ReleaseToNuGet.yml + parameters: + skipPublish: ${{ parameters.skipNugetPublish }} - job: PublishPkgsMsftCom @@ -353,6 +365,8 @@ stages: - group: 'packages.microsoft.com' steps: - template: templates/release-PublishPackageMsftCom.yml + parameters: + skipPublish: ${{ parameters.skipPackagesMsftComPublish }} - stage: PublishSymbols displayName: Publish symbols diff --git a/tools/releaseBuild/azureDevOps/templates/release-PublishPackageMsftCom.yml b/tools/releaseBuild/azureDevOps/templates/release-PublishPackageMsftCom.yml index b5dc97b9ab6..0333c77b88c 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-PublishPackageMsftCom.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-PublishPackageMsftCom.yml @@ -1,3 +1,8 @@ +parameters: + - name: skipPublish + default: false + type: boolean + steps: - template: release-SetReleaseTagAndContainerName.yml @@ -9,19 +14,44 @@ steps: displayName: Set Package version - pwsh: | - git clone https://$(AzureDevOpsPat)@mscodehub.visualstudio.com/PowerShellCore/_git/Internal-PowerShellTeam-Tools '$(Pipeline.Workspace)/tools' + $branch = 'main-mirror' + $gitArgs = "clone", + "--verbose", + "--branch", + "$branch", + "https://$(AzureDevOpsPat)@mscodehub.visualstudio.com/PowerShellCore/_git/Internal-PowerShellTeam-Tools", + '$(Pipeline.Workspace)/tools' + $gitArgs | Write-Verbose -Verbose + git $gitArgs displayName: Clone Internal-PowerShellTeam-Tools from MSCodeHub +- task: PipAuthenticate@1 + inputs: + artifactFeeds: 'pmc' + pythonDownloadServiceConnections: pmcDownload + +- pwsh: | + pip install pmc-cli + + $newPath = (resolve-path '~/.local/bin').providerpath + $vstsCommandString = "vso[task.setvariable variable=PATH]${env:PATH}:$newPath" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + displayName: Install pmc cli + - pwsh: | $metadata = Get-Content -Path "$(Build.SourcesDirectory)/tools/metadata.json" -Raw | ConvertFrom-Json - Write-Verbose -Verbose "$(ReleaseTag) $(RepoClientCliClientID) $(RepoClientCliSecret) $(AzureVersion) $($metadata.LTSRelease.Latest)" $params = @{ ReleaseTag = "$(ReleaseTag)" - AadClientId = "$(RepoClientCliClientID)" - AadClientSecret = "$(RepoClientCliSecret)" + AadClientId = "$(PmcCliClientID)" BlobFolderName = "$(AzureVersion)" LTS = $metadata.LTSRelease.Latest ForProduction = $true + SkipPublish = $${{ parameters.skipPublish }} + MappingFilePath = '$(System.DefaultWorkingDirectory)/tools/packages.microsoft.com/mapping.json' } - & '$(Pipeline.Workspace)/tools/packages.microsoft.com/releaseLinuxPackages.ps1' -MappingFilePath '$(System.DefaultWorkingDirectory)/tools/packages.microsoft.com/mapping.json' @params + + $params | Out-String -width 9999 -Stream | write-Verbose -Verbose + + & '$(Pipeline.Workspace)/tools/packages.microsoft.com-v4/releaseLinuxPackages.ps1' @params displayName: Run release script diff --git a/tools/releaseBuild/azureDevOps/templates/release-ReleaseToNuGet.yml b/tools/releaseBuild/azureDevOps/templates/release-ReleaseToNuGet.yml index 117cf8f91df..33a72f56bbb 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-ReleaseToNuGet.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-ReleaseToNuGet.yml @@ -1,5 +1,11 @@ +parameters: + - name: skipPublish + default: false + type: boolean + steps: - task: DownloadPipelineArtifact@2 + condition: and(eq('${{ parameters.skipPublish }}', 'false'), succeeded()) inputs: source: specific project: PowerShellCore @@ -12,6 +18,7 @@ steps: path: '$(Pipeline.Workspace)/releasePipeline/finalResults' - task: DownloadPipelineArtifact@2 + condition: and(eq('${{ parameters.skipPublish }}', 'false'), succeeded()) inputs: source: specific project: PowerShellCore @@ -37,9 +44,11 @@ steps: Get-ChildItem "$(Pipeline.Workspace)/release" -recurse displayName: Download and capture nupkgs + condition: and(eq('${{ parameters.skipPublish }}', 'false'), succeeded()) - task: NuGetCommand@2 displayName: 'NuGet push' + condition: and(eq('${{ parameters.skipPublish }}', 'false'), succeeded()) inputs: command: push packagesToPush: '$(Pipeline.Workspace)/release/*.nupkg' From d5e2ddb9840cab52d90f40ea1391d0b3da53e2d4 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 11 Sep 2023 17:22:25 -0700 Subject: [PATCH 0006/1168] [release/v7.4.0-preview.6] Continued improvement to tests for release automation (#20182) (#20259) --- .../ConstrainedLanguageRestriction.Tests.ps1 | 2 +- .../PowerShellGet/PowerShellGet.Tests.ps1 | 34 +++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 index acd5a45939e..398bc492711 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 @@ -83,7 +83,7 @@ try $result = Get-Command NestedFn1 2> $null; return ($result -ne $null) '@ - $isCommandAccessible = powershell.exe -noprofile -nologo -c $command + $isCommandAccessible = pwsh.exe -noprofile -nologo -c $command } finally { diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index ef9eec8a0c2..fb5d632765c 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -104,7 +104,24 @@ function Initialize function Remove-InstalledModules { - Get-InstalledModule -Name $TestModule -AllVersions -ErrorAction SilentlyContinue | PowerShellGet\Uninstall-Module -Force + try { + $mod = Get-InstalledModule -Name $TestModule -AllVersions -ErrorAction SilentlyContinue + if ($null -eq $mod) { + return + } + + if (Get-Module -Name $TestModule -ErrorAction Ignore) { + Remove-Module -Force -Name $TestModule + } + + $installedPath = $mod.InstalledLocation + if (Test-Path $installedPath) { + Remove-Item -Force -Recurse $installedPath -ErrorAction Ignore + } + } + catch { + Write-Warning "Remove-InstalledModules: $_" + } } Describe "PowerShellGet - Module tests" -tags "Feature" { @@ -172,7 +189,20 @@ Describe "PowerShellGet - Module tests (Admin)" -Tags @('Feature', 'RequireAdmin function Remove-InstalledScripts { - Get-InstalledScript -Name $TestScript -ErrorAction SilentlyContinue | Uninstall-Script -Force + $installedScript = Get-InstalledScript -Name $TestScript -ErrorAction SilentlyContinue + if ($null -eq $installedScript) { + return + } + + $scriptPath = Join-Path ${installedScript}.InstalledLocation "${TestScript}.ps1" + if (test-Path -Type Leaf -Path $scriptPath) { + Remove-Item -Force -Path $scriptPath -ErrorAction Ignore + } + + $xmlPath = Join-Path ${installedScript}.InstalledLocation InstalledScriptInfos "${TestScript}_InstalledScriptInfo.xml" + if (test-Path -Type Leaf -Path $xmlPath) { + Remove-Item -Force -Path $xmlPath -ErrorAction Ignore + } } Describe "PowerShellGet - Script tests" -tags "Feature" { From 1c22f909ed556f26da4ba19080a5e934af1c50d3 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 11 Sep 2023 17:24:36 -0700 Subject: [PATCH 0007/1168] [release/v7.4.0-preview.6] Enable `vPack` provenance data (#20220) (#20260) --- tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml b/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml index b6d18b8eaaf..61371fcfaa6 100644 --- a/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml +++ b/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml @@ -109,7 +109,7 @@ jobs: platforms: x64 target: '$(System.ArtifactsDirectory)' owner: tplunk - provData: false + provData: true version: '$(vpackVersion)' vpackToken: $(vPackPat) condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual')) From a0cfb3ca1f3eced3172b150f4c15b8e5c07712c0 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 11 Sep 2023 17:37:13 -0700 Subject: [PATCH 0008/1168] [release/v7.4.0-preview.6] Bump `Microsoft.Management.Infrastructure` to 3.0.0-preview.2 (#20226) (#20261) --- .../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 a53b38659e1..281162df4c7 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -45,7 +45,7 @@ - + From 264e30e6fced71a47672655e0d9364b34806d386 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 11 Sep 2023 17:38:08 -0700 Subject: [PATCH 0009/1168] [release/v7.4.0-preview.6] Bump Microsoft.Management.Infrastructure (continued) (#20224) (#20262) --- .../System.Management.Automation.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b19d33fdfba..ea8692d1411 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 @@ -8,7 +8,7 @@ 11.0 - + From 4897be75e772ce16c6437110b8bbf42d2c6a29e5 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 21 Sep 2023 17:22:33 -0700 Subject: [PATCH 0010/1168] Update Microsoft.PowerShell.PSResourceGet to 0.9.0-rc1 (#20274) --- 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 f7abd35a6f7..a96bac9f64d 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -13,7 +13,7 @@ - + From 77e8021256b2c57499a763aaf28691735f9eabce Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Fri, 22 Sep 2023 17:01:22 -0700 Subject: [PATCH 0011/1168] Set experimental features to stable for 7.4 release (#20285) --- .../common/FormatViewGenerator_Table.cs | 2 +- .../engine/BytePipe.cs | 4 +- .../ExperimentalFeature.cs | 20 ------ .../engine/InitialSessionState.cs | 27 +++----- .../engine/NativeCommandProcessor.cs | 66 +++++++------------ .../engine/pipeline.cs | 33 ++++------ .../engine/runtime/Operations/MiscOps.cs | 22 +++---- .../Basic/NativeCommandBytePiping.Tests.ps1 | 5 -- .../NativeCommandErrorHandling.Tests.ps1 | 6 -- 9 files changed, 55 insertions(+), 130 deletions(-) diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs index 442603b448e..64ed5bad6cf 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs @@ -173,7 +173,7 @@ private TableHeaderInfo GenerateTableHeaderInfoFromDataBaseInfo(PSObject so) ci.alignment = colHeader.alignment; if (colHeader.label != null) { - ci.HeaderMatchesProperty = so.Properties[colHeader.label.text] is not null || !ExperimentalFeature.IsEnabled(ExperimentalFeature.PSCustomTableHeaderLabelDecoration); + ci.HeaderMatchesProperty = so.Properties[colHeader.label.text] is not null; ci.label = this.dataBaseInfo.db.displayResourceManagerCache.GetTextTokenString(colHeader.label); } diff --git a/src/System.Management.Automation/engine/BytePipe.cs b/src/System.Management.Automation/engine/BytePipe.cs index 3d4832d6043..03eb827df98 100644 --- a/src/System.Management.Automation/engine/BytePipe.cs +++ b/src/System.Management.Automation/engine/BytePipe.cs @@ -104,9 +104,7 @@ internal static FileBytePipe Create(string fileName, bool append) throw new RuntimeException(null, e, errorRecord); } - ApplicationInsightsTelemetry.SendExperimentalUseData( - ExperimentalFeature.PSNativeCommandPreserveBytePipe, - "f"); + ApplicationInsightsTelemetry.SendExperimentalUseData("PSNativeCommandPreserveBytePipe", "f"); return new FileBytePipe(fileStream); } diff --git a/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs b/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs index 45f8c98e7a0..25d9b6e2743 100644 --- a/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs +++ b/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs @@ -21,14 +21,9 @@ public class ExperimentalFeature #region Const Members internal const string EngineSource = "PSEngine"; - internal const string PSNativeCommandErrorActionPreferenceFeatureName = "PSNativeCommandErrorActionPreference"; - internal const string PSNativeCommandPreserveBytePipe = "PSNativeCommandPreserveBytePipe"; internal const string PSModuleAutoLoadSkipOfflineFilesFeatureName = "PSModuleAutoLoadSkipOfflineFiles"; - internal const string PSCustomTableHeaderLabelDecoration = "PSCustomTableHeaderLabelDecoration"; internal const string PSFeedbackProvider = "PSFeedbackProvider"; internal const string PSCommandWithArgs = "PSCommandWithArgs"; - internal const string PSConstrainedAuditLogging = "PSConstrainedAuditLogging"; - internal const string PSWindowsNativeCommandArgPassing = "PSWindowsNativeCommandArgPassing"; #endregion @@ -120,30 +115,15 @@ static ExperimentalFeature() new ExperimentalFeature( name: "PSLoadAssemblyFromNativeCode", description: "Expose an API to allow assembly loading from native code"), - new ExperimentalFeature( - name: PSNativeCommandErrorActionPreferenceFeatureName, - description: "Native commands with non-zero exit codes issue errors according to $ErrorActionPreference when $PSNativeCommandUseErrorActionPreference is $true"), new ExperimentalFeature( name: PSModuleAutoLoadSkipOfflineFilesFeatureName, description: "Module discovery will skip over files that are marked by cloud providers as not fully on disk."), - new ExperimentalFeature( - name: PSCustomTableHeaderLabelDecoration, - description: "Formatting differentiation for table header labels that aren't property members"), - new ExperimentalFeature( - name: PSNativeCommandPreserveBytePipe, - description: "Byte output is retained when piping between two or more native commands"), new ExperimentalFeature( name: PSFeedbackProvider, description: "Replace the hard-coded suggestion framework with the extensible feedback provider"), new ExperimentalFeature( name: PSCommandWithArgs, description: "Enable `-CommandWithArgs` parameter for pwsh"), - new ExperimentalFeature( - name: PSConstrainedAuditLogging, - description: "PowerShell restriction logging when WDAC (Windows Defender Application Control) Code Integrity policy is set to Audit mode."), - new ExperimentalFeature( - name: "PSWindowsNativeCommandArgPassing", - description: "Enable 'Windows' as the native command argument passing mode"), }; EngineExperimentalFeatures = new ReadOnlyCollection(engineFeatures); diff --git a/src/System.Management.Automation/engine/InitialSessionState.cs b/src/System.Management.Automation/engine/InitialSessionState.cs index d367f4eb106..0a2d3fa74df 100644 --- a/src/System.Management.Automation/engine/InitialSessionState.cs +++ b/src/System.Management.Automation/engine/InitialSessionState.cs @@ -4652,16 +4652,13 @@ static InitialSessionState() #endregion }; - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandErrorActionPreferenceFeatureName)) - { - builtinVariables.Add( - new SessionStateVariableEntry( - SpecialVariables.PSNativeCommandUseErrorActionPreference, - value: true, // when this feature is changed to stable, this should default to `false` - RunspaceInit.PSNativeCommandUseErrorActionPreferenceDescription, - ScopedItemOptions.None, - new ArgumentTypeConverterAttribute(typeof(bool)))); - } + builtinVariables.Add( + new SessionStateVariableEntry( + SpecialVariables.PSNativeCommandUseErrorActionPreference, + value: false, + RunspaceInit.PSNativeCommandUseErrorActionPreferenceDescription, + ScopedItemOptions.None, + new ArgumentTypeConverterAttribute(typeof(bool)))); builtinVariables.Add( new SessionStateVariableEntry( @@ -4677,20 +4674,14 @@ static InitialSessionState() /// /// Assigns the default behavior for native argument passing. /// If the system is non-Windows, we will return Standard. - /// If the experimental feature is enabled, we will return Windows. - /// Otherwise, we will return Legacy. + /// Otherwise, we will return Windows. /// private static NativeArgumentPassingStyle GetPassingStyle() { #if UNIX return NativeArgumentPassingStyle.Standard; #else - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSWindowsNativeCommandArgPassing)) - { - return NativeArgumentPassingStyle.Windows; - } - - return NativeArgumentPassingStyle.Legacy; + return NativeArgumentPassingStyle.Windows; #endif } diff --git a/src/System.Management.Automation/engine/NativeCommandProcessor.cs b/src/System.Management.Automation/engine/NativeCommandProcessor.cs index 8a41b22db1d..02af209f6ed 100644 --- a/src/System.Management.Automation/engine/NativeCommandProcessor.cs +++ b/src/System.Management.Automation/engine/NativeCommandProcessor.cs @@ -397,8 +397,7 @@ internal override void ProcessRecord() { // If upstream is a native command it'll be writing directly to our stdin stream // so we can skip reading here. - if (!ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - || !UpstreamIsNativeCommand) + if (!UpstreamIsNativeCommand) { while (Read()) { @@ -547,7 +546,7 @@ private void InitNativeProcess() // Send Telemetry indicating what argument passing mode we are in. ApplicationInsightsTelemetry.SendExperimentalUseData( - ExperimentalFeature.PSWindowsNativeCommandArgPassing, + "PSWindowsNativeCommandArgPassing", NativeParameterBinderController.ArgumentPassingStyle.ToString()); #if !UNIX @@ -720,9 +719,7 @@ private void InitNativeProcess() lock (_sync) { - if (!_stopped - && (!ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - || !UpstreamIsNativeCommand)) + if (!_stopped && !UpstreamIsNativeCommand) { _inputWriter.Start(_nativeProcess, inputFormat); } @@ -785,21 +782,16 @@ private void InitOutputQueue() if (CommandRuntime.ErrorMergeTo is MshCommandRuntime.MergeDataStream.Output) { StdOutDestination = null; - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe)) + if (DownStreamNativeCommand is not null) { - if (DownStreamNativeCommand is not null) - { - DownStreamNativeCommand.UpstreamIsNativeCommand = false; - DownStreamNativeCommand = null; - } + DownStreamNativeCommand.UpstreamIsNativeCommand = false; + DownStreamNativeCommand = null; } } _nativeProcessOutputQueue = new BlockingCollection(); // we don't assign the handler to anything, because it's used only for objects marshaling - BytePipe stdOutDestination = ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - ? StdOutDestination ?? DownStreamNativeCommand?.CreateBytePipe(stdout: false) - : null; + BytePipe stdOutDestination = StdOutDestination ?? DownStreamNativeCommand?.CreateBytePipe(stdout: false); BytePipe stdOutSource = null; if (stdOutDestination is not null) @@ -822,8 +814,7 @@ private ProcessOutputObject DequeueProcessOutput(bool blocking) { if (blocking) { - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - && _stdOutByteTransfer is not null) + if (_stdOutByteTransfer is not null) { _stdOutByteTransfer.EOF.GetAwaiter().GetResult(); return null; @@ -852,8 +843,7 @@ private ProcessOutputObject DequeueProcessOutput(bool blocking) } else { - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - && _stdOutByteTransfer is not null) + if (_stdOutByteTransfer is not null) { return null; } @@ -896,8 +886,7 @@ internal override void Complete() if (!_isRunningInBackground) { // Wait for input writer to finish. - if (!ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - || !UpstreamIsNativeCommand) + if (!UpstreamIsNativeCommand) { _inputWriter.Done(); } @@ -951,12 +940,6 @@ internal override void Complete() this.commandRuntime.PipelineProcessor.ExecutionFailed = true; - // Feature is not enabled, so return - if (!ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandErrorActionPreferenceFeatureName)) - { - return; - } - // We send telemetry information only if the feature is enabled. // This shouldn't be done once, because it's a run-time check we should send telemetry every time. // Report on the following conditions: @@ -972,12 +955,12 @@ internal override void Complete() // The variable is unset if (useDefaultSetting) { - ApplicationInsightsTelemetry.SendExperimentalUseData(ExperimentalFeature.PSNativeCommandErrorActionPreferenceFeatureName, "unset"); + ApplicationInsightsTelemetry.SendExperimentalUseData("PSNativeCommandErrorActionPreference", "unset"); return; } // Send the value that was set. - ApplicationInsightsTelemetry.SendExperimentalUseData(ExperimentalFeature.PSNativeCommandErrorActionPreferenceFeatureName, nativeErrorActionPreferenceSetting.ToString()); + ApplicationInsightsTelemetry.SendExperimentalUseData("PSNativeCommandErrorActionPreference", nativeErrorActionPreferenceSetting.ToString()); // if it was explicitly set to false, return if (!nativeErrorActionPreferenceSetting) @@ -1266,8 +1249,7 @@ internal void StopProcessing() if (!_runStandAlone) { // Stop input writer - if (!ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - || !UpstreamIsNativeCommand) + if (!UpstreamIsNativeCommand) { _inputWriter.Stop(); } @@ -1815,8 +1797,7 @@ public ProcessOutputHandler( return; } - if (!ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - || stdOutDestination is null) + if (stdOutDestination is null) { _isFirstOutput = true; _isXmlCliOutput = false; @@ -2073,19 +2054,16 @@ internal void Add(object input) object baseObjInput = PSObject.Base(input); - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe)) + if (baseObjInput is byte[] bytes) { - if (baseObjInput is byte[] bytes) - { - _streamWriter.BaseStream.Write(bytes, 0, bytes.Length); - return; - } + _streamWriter.BaseStream.Write(bytes, 0, bytes.Length); + return; + } - if (baseObjInput is byte b) - { - _streamWriter.BaseStream.WriteByte(b); - return; - } + if (baseObjInput is byte b) + { + _streamWriter.BaseStream.WriteByte(b); + return; } AddTextInput(input); diff --git a/src/System.Management.Automation/engine/pipeline.cs b/src/System.Management.Automation/engine/pipeline.cs index a045a4f83ff..e19bf3be843 100644 --- a/src/System.Management.Automation/engine/pipeline.cs +++ b/src/System.Management.Automation/engine/pipeline.cs @@ -261,31 +261,26 @@ private void LogToEventLog() /// internal int Add(CommandProcessorBase commandProcessor) { - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe)) + if (commandProcessor is NativeCommandProcessor nativeCommand) { - if (commandProcessor is NativeCommandProcessor nativeCommand) + if (_lastNativeCommand is not null) { - if (_lastNativeCommand is not null) + // Only report experimental feature usage once per pipeline. + if (!_haveReportedNativePipeUsage) { - // Only report experimental feature usage once per pipeline. - if (!_haveReportedNativePipeUsage) - { - ApplicationInsightsTelemetry.SendExperimentalUseData( - ExperimentalFeature.PSNativeCommandPreserveBytePipe, - "p"); - _haveReportedNativePipeUsage = true; - } - - _lastNativeCommand.DownStreamNativeCommand = nativeCommand; - nativeCommand.UpstreamIsNativeCommand = true; + ApplicationInsightsTelemetry.SendExperimentalUseData("PSNativeCommandPreserveBytePipe", "p"); + _haveReportedNativePipeUsage = true; } - _lastNativeCommand = nativeCommand; - } - else - { - _lastNativeCommand = null; + _lastNativeCommand.DownStreamNativeCommand = nativeCommand; + nativeCommand.UpstreamIsNativeCommand = true; } + + _lastNativeCommand = nativeCommand; + } + else + { + _lastNativeCommand = null; } commandProcessor.CommandRuntime.PipelineProcessor = this; diff --git a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs index 583288905c2..eb3100ea512 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs @@ -221,10 +221,7 @@ private static CommandProcessorBase AddCommand(PipelineProcessor pipe, bool redirectedInformation = false; if (redirections != null) { - bool shouldProcessMergesFirst = ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - && isNativeCommand; - - if (shouldProcessMergesFirst) + if (isNativeCommand) { foreach (CommandRedirection redirection in redirections) { @@ -237,7 +234,7 @@ private static CommandProcessorBase AddCommand(PipelineProcessor pipe, foreach (CommandRedirection redirection in redirections) { - if (!shouldProcessMergesFirst || redirection is not MergingRedirection) + if (!isNativeCommand || redirection is not MergingRedirection) { redirection.Bind(pipe, commandProcessor, context); } @@ -1081,16 +1078,13 @@ public override string ToString() // dir > out internal override void Bind(PipelineProcessor pipelineProcessor, CommandProcessorBase commandProcessor, ExecutionContext context) { - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe)) + if (commandProcessor is NativeCommandProcessor nativeCommand + && nativeCommand.CommandRuntime.ErrorMergeTo is not MshCommandRuntime.MergeDataStream.Output + && FromStream is RedirectionStream.Output + && !string.IsNullOrWhiteSpace(File)) { - if (commandProcessor is NativeCommandProcessor nativeCommand - && nativeCommand.CommandRuntime.ErrorMergeTo is not MshCommandRuntime.MergeDataStream.Output - && FromStream is RedirectionStream.Output - && !string.IsNullOrWhiteSpace(File)) - { - nativeCommand.StdOutDestination = FileBytePipe.Create(File, Appending); - return; - } + nativeCommand.StdOutDestination = FileBytePipe.Create(File, Appending); + return; } Pipe pipe = GetRedirectionPipe(context, pipelineProcessor); diff --git a/test/powershell/engine/Basic/NativeCommandBytePiping.Tests.ps1 b/test/powershell/engine/Basic/NativeCommandBytePiping.Tests.ps1 index 1e645df9030..236cbd8c9e6 100644 --- a/test/powershell/engine/Basic/NativeCommandBytePiping.Tests.ps1 +++ b/test/powershell/engine/Basic/NativeCommandBytePiping.Tests.ps1 @@ -8,11 +8,6 @@ Describe 'Native command byte piping tests' -Tags 'CI' { BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() - if (-not [ExperimentalFeature]::IsEnabled('PSNativeCommandPreserveBytePipe')) - { - $PSDefaultParameterValues['It:Skip'] = $true - return - } # Without this the test would otherwise be hard coded to a specific set # of [Console]::OutputEncoding/$OutputEncoding settings. diff --git a/test/powershell/engine/Basic/NativeCommandErrorHandling.Tests.ps1 b/test/powershell/engine/Basic/NativeCommandErrorHandling.Tests.ps1 index 055382bb5e1..8122e598d2c 100644 --- a/test/powershell/engine/Basic/NativeCommandErrorHandling.Tests.ps1 +++ b/test/powershell/engine/Basic/NativeCommandErrorHandling.Tests.ps1 @@ -7,12 +7,6 @@ Describe 'Native command error handling tests' -Tags 'CI' { BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() - if (-not [ExperimentalFeature]::IsEnabled('PSNativeCommandErrorActionPreference')) - { - $PSDefaultParameterValues['It:Skip'] = $true - return - } - $exeName = $IsWindows ? 'testexe.exe' : 'testexe' $exePath = @(Get-Command $exeName -Type Application)[0].Path From 242af6adb578525a3a9e37b0e7ebfde8371c1295 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 25 Sep 2023 09:28:14 -0700 Subject: [PATCH 0012/1168] Fix the release build by moving to the official .NET 8-rc.1 release build version (#20333) --- build.psm1 | 12 ++++++------ global.json | 2 +- ...rosoft.PowerShell.Commands.Diagnostics.csproj | 2 +- ...crosoft.PowerShell.Commands.Management.csproj | 2 +- .../Microsoft.PowerShell.Commands.Utility.csproj | 4 ++-- .../Microsoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 8 ++++---- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 16 ++++++++-------- .../powershell-win-core.csproj | 2 +- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 ++-- tools/findMissingNotices.ps1 | 4 ++-- tools/packaging/packaging.psm1 | 10 +++++----- .../GenericLinuxFiles/PowerShellPackage.ps1 | 2 +- 15 files changed, 37 insertions(+), 37 deletions(-) diff --git a/build.psm1 b/build.psm1 index 235d9aed3ea..27b0e493e4c 100644 --- a/build.psm1 +++ b/build.psm1 @@ -273,7 +273,7 @@ function Test-IsReleaseCandidate return $false } -$optimizedFddRegex = 'fxdependent-(linux|alpine|win|win7|osx)-(x64|x86|arm64|arm)' +$optimizedFddRegex = 'fxdependent-(linux|linux-musl|win|win7|osx)-(x64|x86|arm64|arm)' function Start-PSBuild { [CmdletBinding(DefaultParameterSetName="Default")] @@ -307,9 +307,9 @@ function Start-PSBuild { # These runtimes must match those in project.json # We do not use ValidateScript since we want tab completion # If this parameter is not provided it will get determined automatically. - [ValidateSet("alpine-x64", + [ValidateSet("linux-musl-x64", "fxdependent", - "fxdependent-alpine-x64", + "fxdependent-linux-musl-x64", "fxdependent-linux-x64", "fxdependent-linux-arm64", "fxdependent-win-desktop", @@ -898,9 +898,9 @@ function New-PSOptions { # These are duplicated from Start-PSBuild # We do not use ValidateScript since we want tab completion [ValidateSet("", - "alpine-x64", + "linux-musl-x64", "fxdependent", - "fxdependent-alpine-x64", + "fxdependent-linux-musl-x64", "fxdependent-linux-x64", "fxdependent-linux-arm64", "fxdependent-win-desktop", @@ -1346,7 +1346,7 @@ function Start-PSPester { # if we are building for Alpine, we must include the runtime as linux-x64 # will not build runnable test tools if ( $environment.IsLinux -and $environment.IsAlpine ) { - $publishArgs['runtime'] = 'alpine-x64' + $publishArgs['runtime'] = 'linux-musl-x64' } Publish-PSTestTools @publishArgs | ForEach-Object {Write-Host $_} diff --git a/global.json b/global.json index 1c036716cc1..adc56119682 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.100-rc.1.23455.8" + "version": "8.0.100-rc.1.23463.5" } } diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj index d85cf9797dc..e3fc9bd3cf3 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj @@ -8,7 +8,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 a76c7cd3dc9..4952214240a 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 9e71d3ebd6c..ce30e68eab6 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -33,8 +33,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 2e0f4153b04..5922c52e366 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 16b011fc4ee..3082c48bc23 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -19,9 +19,9 @@ - - - + + + - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index bacaa026f30..4ab85c79597 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index b33f4a8c045..0a11150a782 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -34,16 +34,16 @@ - - - - + + + + - + - - - + + + diff --git a/src/powershell-win-core/powershell-win-core.csproj b/src/powershell-win-core/powershell-win-core.csproj index 87a8221a689..73c55497c5b 100644 --- a/src/powershell-win-core/powershell-win-core.csproj +++ b/src/powershell-win-core/powershell-win-core.csproj @@ -8,7 +8,7 @@ true true true - win7-x86;win7-x64 + win-x86;win-x64 Microsoft.PowerShell ..\..\assets\pwsh.manifest Windows diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index d1298eed38a..561dac20d1f 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 6068ea71a65..89e69a428fa 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/tools/findMissingNotices.ps1 b/tools/findMissingNotices.ps1 index 0ea53c665b4..e267f718a33 100644 --- a/tools/findMissingNotices.ps1 +++ b/tools/findMissingNotices.ps1 @@ -159,7 +159,7 @@ function Get-CGRegistrations { param( [Parameter(Mandatory)] [ValidateSet( - "alpine-x64", + "linux-musl-x64", "linux-arm", "linux-arm64", "linux-x64", @@ -265,7 +265,7 @@ function Get-CGRegistrations { $registrations = [System.Collections.Generic.Dictionary[string, Registration]]::new() $lastCount = 0 $registrationChanged = $false -foreach ($runtime in "win7-x64", "linux-x64", "osx-x64", "alpine-x64", "win-arm", "linux-arm", "linux-arm64", "osx-arm64", "win-arm64", "win7-x86") { +foreach ($runtime in "win7-x64", "linux-x64", "osx-x64", "linux-musl-x64", "win-arm", "linux-arm", "linux-arm64", "osx-arm64", "win-arm64", "win7-x86") { $registrationChanged = (Get-CGRegistrations -Runtime $runtime -RegistrationTable $registrations) -or $registrationChanged $count = $registrations.Count $newCount = $count - $lastCount diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index eabf45cf01f..e40e8446308 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -100,7 +100,7 @@ function Start-PSPackage { } elseif ($MacOSRuntime) { $MacOSRuntime, "Release" } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-alpine") { - New-PSOptions -Configuration "Release" -Runtime "alpine-x64" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } + New-PSOptions -Configuration "Release" -Runtime "linux-musl-x64" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-arm") { New-PSOptions -Configuration "Release" -Runtime "Linux-ARM" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-arm64") { @@ -115,7 +115,7 @@ function Start-PSPackage { New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-arm64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-alpine-fxdependent") { - New-PSOptions -Configuration "Release" -Runtime 'fxdependent-alpine-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } + New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-musl-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } else { New-PSOptions -Configuration "Release" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } @@ -594,7 +594,7 @@ function Start-PSPackage { Name = $Name Version = $Version Force = $Force - Architecture = "alpine-x64" + Architecture = "linux-musl-x64" ExcludeSymbolicLinks = $true R2RVerification = [R2RVerification]@{ R2RState = 'R2R' @@ -4513,7 +4513,7 @@ function Invoke-AzDevOpsLinuxPackageBuild { $buildParams.Add("Runtime", "fxdependent") } 'alpine' { - $buildParams.Add("Runtime", 'alpine-x64') + $buildParams.Add("Runtime", 'linux-musl-x64') } } @@ -4606,7 +4606,7 @@ function Invoke-AzDevOpsLinuxPackageBuild { Remove-Item -Path $binDir -Recurse -Force } - $buildParams['Runtime'] = 'fxdependent-alpine-x64' + $buildParams['Runtime'] = 'fxdependent-linux-musl-x64' $buildFolder = "${env:SYSTEM_ARTIFACTSDIRECTORY}/${amd64AlpineFxdBuildFolder}" Start-PSBuild -Clean @buildParams @releaseTagParam -Output $buildFolder -PSOptionsPath "${buildFolder}-meta/psoptions.json" # Remove symbol files, xml document files. diff --git a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 index f96263ea6e8..ae04aed5ea3 100644 --- a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 @@ -59,7 +59,7 @@ function BuildPackages { $buildParams.Add("Runtime", "fxdependent") } elseif ($Alpine.IsPresent) { $projectAssetsZipName = 'linuxAlpineProjectAssetssymbols.zip' - $buildParams.Add("Runtime", 'alpine-x64') + $buildParams.Add("Runtime", 'linux-musl-x64') } else { # make the artifact name unique $projectAssetsZipName = "linuxProjectAssets-$((Get-Date).Ticks)-symbols.zip" From afff843868b39c1e30ff7d385bf073538098a922 Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Mon, 25 Sep 2023 09:29:30 -0700 Subject: [PATCH 0013/1168] Update experimental-feature json files (#20335) --- experimental-feature-linux.json | 7 +------ experimental-feature-windows.json | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/experimental-feature-linux.json b/experimental-feature-linux.json index 4e413efbfc9..5adfecd7075 100644 --- a/experimental-feature-linux.json +++ b/experimental-feature-linux.json @@ -1,13 +1,8 @@ [ "PSCommandNotFoundSuggestion", "PSCommandWithArgs", - "PSConstrainedAuditLogging", - "PSCustomTableHeaderLabelDecoration", "PSFeedbackProvider", "PSLoadAssemblyFromNativeCode", "PSModuleAutoLoadSkipOfflineFiles", - "PSNativeCommandErrorActionPreference", - "PSNativeCommandPreserveBytePipe", - "PSSubsystemPluginModel", - "PSWindowsNativeCommandArgPassing" + "PSSubsystemPluginModel" ] diff --git a/experimental-feature-windows.json b/experimental-feature-windows.json index 4e413efbfc9..5adfecd7075 100644 --- a/experimental-feature-windows.json +++ b/experimental-feature-windows.json @@ -1,13 +1,8 @@ [ "PSCommandNotFoundSuggestion", "PSCommandWithArgs", - "PSConstrainedAuditLogging", - "PSCustomTableHeaderLabelDecoration", "PSFeedbackProvider", "PSLoadAssemblyFromNativeCode", "PSModuleAutoLoadSkipOfflineFiles", - "PSNativeCommandErrorActionPreference", - "PSNativeCommandPreserveBytePipe", - "PSSubsystemPluginModel", - "PSWindowsNativeCommandArgPassing" + "PSSubsystemPluginModel" ] From 35d0be80dfe989656e35433e37164b1ceae25d93 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 10:04:12 -0700 Subject: [PATCH 0014/1168] [release/v7.4.0-preview.6] Put the calls to `Set-AzDoProjectInfo` and Set-AzDoAuthToken` in the right order (#20306) (#20347) --- tools/releaseBuild/azureDevOps/releasePipeline.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/releasePipeline.yml b/tools/releaseBuild/azureDevOps/releasePipeline.yml index 5ca465a74f1..72123ba7d8f 100644 --- a/tools/releaseBuild/azureDevOps/releasePipeline.yml +++ b/tools/releaseBuild/azureDevOps/releasePipeline.yml @@ -210,8 +210,8 @@ stages: - pwsh: | Get-ChildItem -Path $(Build.SourcesDirectory) Import-Module $(Build.SourcesDirectory)\ReleaseTools\AzDO -Force - Set-AzDoAuthToken -Token $(RELEASEAUTOMATIONPAT) Set-AzDoProjectInfo -ProjectOwner PowerShell-Rel -ProjectName Release-Automation + Set-AzDoAuthToken -Token $(RELEASEAUTOMATIONPAT) $packageBuildID = $(resources.pipeline.releasePipeline.runID) $metadata = Get-Content -Raw -Path '$(Pipeline.Workspace)/releasePipeline/metadata/release.json' | ConvertFrom-Json $buildInvocationInfo = Start-AzDOBuild -BuildDefinitionId 10 -BuildArguments @{ POWERSHELL_PACKAGE_BUILD_BUILDID = $packageBuildID } -Tag $metadata.ReleaseVersion, 'InProgress' -PassThru @@ -253,8 +253,8 @@ stages: - pwsh: | Import-Module $(Build.SourcesDirectory)\ReleaseTools\AzDO -Force - Set-AzDoAuthToken -Token $(RELEASEAUTOMATIONPAT) Set-AzDoProjectInfo -ProjectOwner PowerShell-Rel -ProjectName Release-Automation + Set-AzDoAuthToken -Token $(RELEASEAUTOMATIONPAT) $metadata = Get-Content -Raw -Path '$(Pipeline.Workspace)/releasePipeline/metadata/release.json' | ConvertFrom-Json $azDOBuild = Get-AzDOBuild -buildDefinitionId 10 -MaximumResult 100 | Where-Object { $_.tags -in $metadata.ReleaseVersion } $azDoBuild | Remove-AzDOBuildTag -tag 'InProgress' -Pass | Add-AzDOBuildTag -tag 'SignedOff' @@ -434,8 +434,8 @@ stages: path: '$(Pipeline.Workspace)/releasePipeline/metadata' - pwsh: | Import-Module $(Build.SourcesDirectory)\ReleaseTools\AzDO -Force - Set-AzDoAuthToken -Token $(RELEASEAUTOMATIONPAT) Set-AzDoProjectInfo -ProjectOwner PowerShell-Rel -ProjectName PowerShell + Set-AzDoAuthToken -Token $(RELEASEAUTOMATIONPAT) $metadata = Get-Content -Raw -Path '$(Pipeline.Workspace)/releasePipeline/metadata/release.json' | ConvertFrom-Json $buildInvocationInfo = Start-AzDOBuild -BuildDefinitionId 49 -Tag $metadata.ReleaseVersion, 'InProgress' -PassThru Write-Verbose -Verbose "Kicked off snap build: $($buildInvocationInfo.WebUrl)" @@ -475,8 +475,8 @@ stages: path: '$(Pipeline.Workspace)/releasePipeline/metadata' - pwsh: | Import-Module $(Build.SourcesDirectory)\ReleaseTools\AzDO -Force - Set-AzDoAuthToken -Token $(RELEASEAUTOMATIONPAT) Set-AzDoProjectInfo -ProjectOwner PowerShell-Rel -ProjectName PowerShell + Set-AzDoAuthToken -Token $(RELEASEAUTOMATIONPAT) $metadata = Get-Content -Raw -Path '$(Pipeline.Workspace)/releasePipeline/metadata/release.json' | ConvertFrom-Json $azDOBuild = Get-AzDOBuild -buildDefinitionId 49 -MaximumResult 100 | Where-Object { $_.tags -in $metadata.ReleaseVersion } $azDoBuild | Remove-AzDOBuildTag -tag 'InProgress' -Pass | Add-AzDOBuildTag -tag 'SignedOff' @@ -579,8 +579,8 @@ stages: - pwsh: | Import-Module $(Build.SourcesDirectory)\ReleaseTools\AzDO -Force - Set-AzDoAuthToken -Token $(MSCODEHUBPAT) Set-AzDoProjectInfo -ProjectOwner mscodehub -ProjectName PowerShellCore + Set-AzDoAuthToken -Token $(MSCODEHUBPAT) $metadata = Get-Content -Raw -Path '$(Pipeline.Workspace)/releasePipeline/metadata/release.json' | ConvertFrom-Json $releaseVersion = $metadata.ReleaseVersion -replace '^v','' $semanticVersion = [System.Management.Automation.SemanticVersion]$releaseVersion From 90f64aa02ca389c70d62167238ef67abb84ba289 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 10:10:00 -0700 Subject: [PATCH 0015/1168] [release/v7.4.0-preview.6] Release build: Change the names of the PATs (#20307) (#20349) --- tools/releaseBuild/azureDevOps/releasePipeline.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/releasePipeline.yml b/tools/releaseBuild/azureDevOps/releasePipeline.yml index 72123ba7d8f..b893a8f5cf9 100644 --- a/tools/releaseBuild/azureDevOps/releasePipeline.yml +++ b/tools/releaseBuild/azureDevOps/releasePipeline.yml @@ -41,6 +41,7 @@ variables: - name: BUILDSECMON_OPT_IN value: true - group: ReleasePipelineSecrets + - group: PipelineExecutionPats stages: - stage: MSIXBundle @@ -211,7 +212,7 @@ stages: Get-ChildItem -Path $(Build.SourcesDirectory) Import-Module $(Build.SourcesDirectory)\ReleaseTools\AzDO -Force Set-AzDoProjectInfo -ProjectOwner PowerShell-Rel -ProjectName Release-Automation - Set-AzDoAuthToken -Token $(RELEASEAUTOMATIONPAT) + Set-AzDoAuthToken -Token $(powershellRelExecutionPat) $packageBuildID = $(resources.pipeline.releasePipeline.runID) $metadata = Get-Content -Raw -Path '$(Pipeline.Workspace)/releasePipeline/metadata/release.json' | ConvertFrom-Json $buildInvocationInfo = Start-AzDOBuild -BuildDefinitionId 10 -BuildArguments @{ POWERSHELL_PACKAGE_BUILD_BUILDID = $packageBuildID } -Tag $metadata.ReleaseVersion, 'InProgress' -PassThru @@ -254,7 +255,7 @@ stages: - pwsh: | Import-Module $(Build.SourcesDirectory)\ReleaseTools\AzDO -Force Set-AzDoProjectInfo -ProjectOwner PowerShell-Rel -ProjectName Release-Automation - Set-AzDoAuthToken -Token $(RELEASEAUTOMATIONPAT) + Set-AzDoAuthToken -Token $(powershellRelExecutionPat) $metadata = Get-Content -Raw -Path '$(Pipeline.Workspace)/releasePipeline/metadata/release.json' | ConvertFrom-Json $azDOBuild = Get-AzDOBuild -buildDefinitionId 10 -MaximumResult 100 | Where-Object { $_.tags -in $metadata.ReleaseVersion } $azDoBuild | Remove-AzDOBuildTag -tag 'InProgress' -Pass | Add-AzDOBuildTag -tag 'SignedOff' @@ -435,7 +436,7 @@ stages: - pwsh: | Import-Module $(Build.SourcesDirectory)\ReleaseTools\AzDO -Force Set-AzDoProjectInfo -ProjectOwner PowerShell-Rel -ProjectName PowerShell - Set-AzDoAuthToken -Token $(RELEASEAUTOMATIONPAT) + Set-AzDoAuthToken -Token $(powershellRelExecutionPat) $metadata = Get-Content -Raw -Path '$(Pipeline.Workspace)/releasePipeline/metadata/release.json' | ConvertFrom-Json $buildInvocationInfo = Start-AzDOBuild -BuildDefinitionId 49 -Tag $metadata.ReleaseVersion, 'InProgress' -PassThru Write-Verbose -Verbose "Kicked off snap build: $($buildInvocationInfo.WebUrl)" @@ -476,7 +477,7 @@ stages: - pwsh: | Import-Module $(Build.SourcesDirectory)\ReleaseTools\AzDO -Force Set-AzDoProjectInfo -ProjectOwner PowerShell-Rel -ProjectName PowerShell - Set-AzDoAuthToken -Token $(RELEASEAUTOMATIONPAT) + Set-AzDoAuthToken -Token $(powershellRelExecutionPat) $metadata = Get-Content -Raw -Path '$(Pipeline.Workspace)/releasePipeline/metadata/release.json' | ConvertFrom-Json $azDOBuild = Get-AzDOBuild -buildDefinitionId 49 -MaximumResult 100 | Where-Object { $_.tags -in $metadata.ReleaseVersion } $azDoBuild | Remove-AzDOBuildTag -tag 'InProgress' -Pass | Add-AzDOBuildTag -tag 'SignedOff' @@ -580,7 +581,7 @@ stages: - pwsh: | Import-Module $(Build.SourcesDirectory)\ReleaseTools\AzDO -Force Set-AzDoProjectInfo -ProjectOwner mscodehub -ProjectName PowerShellCore - Set-AzDoAuthToken -Token $(MSCODEHUBPAT) + Set-AzDoAuthToken -Token $(mscodehubBuildExecutionPat) $metadata = Get-Content -Raw -Path '$(Pipeline.Workspace)/releasePipeline/metadata/release.json' | ConvertFrom-Json $releaseVersion = $metadata.ReleaseVersion -replace '^v','' $semanticVersion = [System.Management.Automation.SemanticVersion]$releaseVersion From e87ef9ef1feb46d5442130f136321d049937b882 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 10:11:18 -0700 Subject: [PATCH 0016/1168] Bump XunitXml.TestLogger from 3.1.11 to 3.1.17 (#20293) --- 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 afcd685f5ee..8e1b52c7a8c 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -26,7 +26,7 @@ - + From f57878b7848bcb663a83bc00754771f07ae04e51 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 10:49:57 -0700 Subject: [PATCH 0017/1168] [release/v7.4.0-preview.6] Remove the comment trigger from feedback provider (#20136) (#20346) --- .../Subsystem/FeedbackSubsystem/FeedbackHub.cs | 7 +++---- .../FeedbackSubsystem/IFeedbackProvider.cs | 13 ++++--------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/FeedbackHub.cs b/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/FeedbackHub.cs index 7dfe79a2cd9..588cf086d42 100644 --- a/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/FeedbackHub.cs +++ b/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/FeedbackHub.cs @@ -183,12 +183,10 @@ public static class FeedbackHub private static bool CanSkip(IEnumerable providers) { - const FeedbackTrigger possibleTriggerOnSuccess = FeedbackTrigger.Success | FeedbackTrigger.Comment; - bool canSkip = true; foreach (IFeedbackProvider provider in providers) { - if ((provider.Trigger & possibleTriggerOnSuccess) != 0) + if (provider.Trigger.HasFlag(FeedbackTrigger.Success)) { canSkip = false; break; @@ -249,7 +247,8 @@ private static bool TryGetFeedbackContext( if (IsPureComment(tokens)) { - trigger = FeedbackTrigger.Comment; + // Don't trigger anything in this case. + return false; } else if (questionMarkValue) { diff --git a/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/IFeedbackProvider.cs b/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/IFeedbackProvider.cs index d028e5baa62..1446983f791 100644 --- a/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/IFeedbackProvider.cs +++ b/src/System.Management.Automation/engine/Subsystem/FeedbackSubsystem/IFeedbackProvider.cs @@ -18,32 +18,27 @@ namespace System.Management.Automation.Subsystem.Feedback [Flags] public enum FeedbackTrigger { - /// - /// The last command line is comment only. - /// - Comment = 0x0001, - /// /// The last command line executed successfully. /// - Success = 0x0002, + Success = 0x0001, /// /// The last command line failed due to a command-not-found error. /// This is a special case of . /// - CommandNotFound = 0x0004, + CommandNotFound = 0x0002, /// /// The last command line failed with an error record. /// This includes the case of command-not-found error. /// - Error = CommandNotFound | 0x0008, + Error = CommandNotFound | 0x0004, /// /// All possible triggers. /// - All = Comment | Success | Error + All = Success | Error } /// From c1b7226dd0f3058fc1a49504def6cd62366d1a1e Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 10:51:17 -0700 Subject: [PATCH 0018/1168] [release/v7.4.0-preview.6] Bump `Microsoft.CodeAnalysis.CSharp` from 4.7.0-2.final to 4.7.0 (#20146) (#20350) --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- .../PSVersionInfoGenerator/PSVersionInfoGenerator.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 328718e9c07..18880b1b68c 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,7 +32,7 @@ - + diff --git a/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj b/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj index c7971775068..d46e259fb52 100644 --- a/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj +++ b/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj @@ -13,7 +13,7 @@ - + From 42f43a1d00bcefe18601235071cc0792d766ac0e Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 10:52:02 -0700 Subject: [PATCH 0019/1168] [release/v7.4.0-preview.6] Bump `Microsoft.NET.Test.Sdk` from 17.7.0 to 17.7.1 (#20130) (#20351) --- 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 6665f8a4754..193a012f437 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -27,7 +27,7 @@ - + From ea9cf42d5d1a6b8923f3eb813855110c09ed9c40 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 10:52:40 -0700 Subject: [PATCH 0020/1168] [release/v7.4.0-preview.6] Bump actions/checkout from 3 to 4 (#20205) (#20352) --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/markdownLink.yml | 4 ++-- .github/workflows/markdownLinkDaily.yml | 2 +- .github/workflows/rebase.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6463ce67ff1..a18163af84d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -37,7 +37,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: '0' diff --git a/.github/workflows/markdownLink.yml b/.github/workflows/markdownLink.yml index b7df90232f6..9f66988fe95 100644 --- a/.github/workflows/markdownLink.yml +++ b/.github/workflows/markdownLink.yml @@ -12,7 +12,7 @@ jobs: markdown-link-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: gaurav-nelson/github-action-markdown-link-check@v1 with: use-quiet-mode: 'yes' @@ -26,7 +26,7 @@ jobs: statuses: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Full git history is needed to get a proper # list of changed files within `super-linter` diff --git a/.github/workflows/markdownLinkDaily.yml b/.github/workflows/markdownLinkDaily.yml index 7a4a1259a64..557b801273d 100644 --- a/.github/workflows/markdownLinkDaily.yml +++ b/.github/workflows/markdownLinkDaily.yml @@ -18,7 +18,7 @@ jobs: if: github.repository == 'PowerShell/PowerShell' steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check Links uses: gaurav-nelson/github-action-markdown-link-check@v1 with: diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 05cb478196e..faf5ddda535 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the latest code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Post rebase started comment to pull request From 3f96e9e2c02b95161d8399475520e230ce6a822a Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 10:53:32 -0700 Subject: [PATCH 0021/1168] [release/v7.4.0-preview.6] Bump JsonSchema.Net from 5.1.3 to 5.2.1 (#20193) (#20353) --- .../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 18880b1b68c..01dc6212acb 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -35,7 +35,7 @@ - + From c2621277bd2a8ee3110306a24ad5b3c20af69638 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 10:54:06 -0700 Subject: [PATCH 0022/1168] [release/v7.4.0-preview.6] Bump Markdig.Signed from 0.32.0 to 0.33.0 (#20186) (#20354) --- .../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 01dc6212acb..9658b03d2e1 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -8,7 +8,7 @@ - + From 26fce6118562b84aa4bef8e4762edf6a0083154d Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 11:06:21 -0700 Subject: [PATCH 0023/1168] [release/v7.4.0-preview.6] Bump `Microsoft.NET.Test.Sdk` from 17.7.1 to 17.7.2 (#20185) (#20355) --- 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 193a012f437..b3daa34dd7c 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -27,7 +27,7 @@ - + From 3c66c99a708f1ca44c7b2530f4a974b9bc8b74d2 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 11:07:44 -0700 Subject: [PATCH 0024/1168] [release/v7.4.0-preview.6] Bump `JsonSchema.Net` from 5.2.1 to 5.2.5 (#20225) (#20356) --- .../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 9658b03d2e1..7658d48c8f1 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -35,7 +35,7 @@ - + From 1f5e71178744209c6e7f3f74df368b9dcf2c54bc Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 11:08:36 -0700 Subject: [PATCH 0025/1168] [release/v7.4.0-preview.6] Bump `xunit.runner.visualstudio` from `2.5.0` to `2.5.1` (#20294) (#20357) --- 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 b3daa34dd7c..577150aba25 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -25,7 +25,7 @@ - + From 9f0044315dee6e0fa7539fd6b5d15d56411f2274 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 11:21:07 -0700 Subject: [PATCH 0026/1168] [release/v7.4.0-preview.6] Add mapping for mariner arm64 stable (#20213) (#20348) --- tools/packages.microsoft.com/mapping.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/packages.microsoft.com/mapping.json b/tools/packages.microsoft.com/mapping.json index 48e93bba724..f9d673d5482 100644 --- a/tools/packages.microsoft.com/mapping.json +++ b/tools/packages.microsoft.com/mapping.json @@ -28,6 +28,14 @@ ], "PackageFormat": "PACKAGE_NAME-POWERSHELL_RELEASE-1.rh.x86_64.rpm" }, + { + "url": "cbl-mariner-2.0-prod-Microsoft-aarch64", + "distribution": [ + "bionic" + ], + "PackageFormat": "PACKAGE_NAME-POWERSHELL_RELEASE-1.cm.aarch64.rpm", + "channel": "stable" + }, { "url": "cbl-mariner-2.0-prod-Microsoft-x86_64", "distribution": [ From 3b42cacc99cd343ea0c7b232cf5c1d647a02b539 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:31:32 -0700 Subject: [PATCH 0027/1168] Bump `Microsoft.CodeAnalysis.CSharp` from 4.7.0 to 4.8.0-2.final (#20321) --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- .../PSVersionInfoGenerator/PSVersionInfoGenerator.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 ce30e68eab6..6b1e87ae441 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,7 +32,7 @@ - + diff --git a/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj b/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj index d46e259fb52..4cc9ed73321 100644 --- a/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj +++ b/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj @@ -13,7 +13,7 @@ - + From 963bf1e0ade35e0d954196d0b7a61da30e3d5bd1 Mon Sep 17 00:00:00 2001 From: Zhoneym <140673973+Zhoneym@users.noreply.github.com> Date: Tue, 26 Sep 2023 03:05:14 +0800 Subject: [PATCH 0028/1168] Update AppxManifest.xml to show application name on DefaultTile for Windows 10 21H2/22H2 Start Menu (#20080) * Attempt to fix the issue of Powershell magnet icon being too large on the Windows 10 start menu and not displaying the application name * Update assets/AppxManifest.xml --------- Co-authored-by: Dongbo Wang --- assets/AppxManifest.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/AppxManifest.xml b/assets/AppxManifest.xml index c646bcdf94b..ec0caa6a37c 100644 --- a/assets/AppxManifest.xml +++ b/assets/AppxManifest.xml @@ -37,6 +37,11 @@ + + + + + From 094033c7c99a01aede9f145a6096b827046173f0 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 12:10:21 -0700 Subject: [PATCH 0029/1168] [release/v7.4.0-preview.6] Use `fxdependent-win-desktop` runtime for compliance runs (#20326) (#20359) Co-authored-by: Aditya Patwardhan --- tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml index bf631b3acc1..e15a42ff63c 100644 --- a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml +++ b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml @@ -55,7 +55,7 @@ jobs: - pwsh: | Import-Module .\build.psm1 -force Find-DotNet - Start-PSBuild -Configuration StaticAnalysis -PSModuleRestore -Clean + Start-PSBuild -Configuration StaticAnalysis -PSModuleRestore -Clean -Runtime fxdependent-win-desktop $OutputFolder = Split-Path (Get-PSOutput) Write-Host "##vso[task.setvariable variable=BinDir]$OutputFolder" From 21600d6327039b4146fe6de753be1b3d52e67b5b Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 12:29:00 -0700 Subject: [PATCH 0030/1168] [release/v7.4.0-preview.6] Update .NET SDK to version 8.0.100-rc.1.23455.8 (#20269) (#20358) --- DotnetRuntimeMetadata.json | 4 ++-- build.psm1 | 16 ++++++++++++++++ global.json | 2 +- ...rosoft.PowerShell.Commands.Diagnostics.csproj | 2 +- ...crosoft.PowerShell.Commands.Management.csproj | 2 +- .../Microsoft.PowerShell.Commands.Utility.csproj | 6 +++--- .../Microsoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 8 ++++---- .../Microsoft.WSMan.Management.csproj | 2 +- src/ResGen/ResGen.csproj | 2 +- .../System.Management.Automation.csproj | 16 ++++++++-------- .../engine/parser/ast.cs | 3 +-- .../engine/remoting/commands/PSRemotingCmdlet.cs | 8 ++++---- .../engine/remoting/commands/ReceivePSSession.cs | 6 +++--- .../namespaces/FileSystemProvider.cs | 12 +----------- src/TypeCatalogGen/TypeCatalogGen.csproj | 2 +- test/hosting/hosting.tests.csproj | 1 - .../BenchmarkDotNet.Extensions.csproj | 4 ++-- .../ResultsComparer/ResultsComparer.csproj | 2 +- ...crosoft.PowerShell.NamedPipeConnection.csproj | 2 +- test/tools/TestExe/TestExe.csproj | 2 +- test/tools/TestService/TestService.csproj | 4 ++-- test/tools/UnixSocket/UnixSocket.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 ++-- test/xUnit/xUnit.tests.csproj | 2 +- 25 files changed, 60 insertions(+), 56 deletions(-) diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json index fa2b70fd18c..464ca8a6291 100644 --- a/DotnetRuntimeMetadata.json +++ b/DotnetRuntimeMetadata.json @@ -1,9 +1,9 @@ { "sdk": { - "channel": "8.0.1xx-preview7", + "channel": "8.0.1xx-rc1", "quality": "daily", "qualityFallback": "preview", - "packageVersionPattern": "8.0.0-preview.7", + "packageVersionPattern": "8.0.0-rc.1", "sdkImageVersion": "8.0.100", "nextChannel": "8.0.1xx-preview4", "azureFeed": "", diff --git a/build.psm1 b/build.psm1 index a226bde5349..235d9aed3ea 100644 --- a/build.psm1 +++ b/build.psm1 @@ -457,6 +457,17 @@ Fix steps: $Arguments += "--self-contained" } + if ($Options.Runtime -like 'win*') { + # Starting in .NET 8, the .NET SDK won't recognize version-specific RIDs by default, such as win7-x64, + # see https://learn.microsoft.com/dotnet/core/compatibility/sdk/8.0/rid-graph for details. + # It will cause huge amount of changes in our build infrastructure because our building and packaging + # scripts have the 'win7-xx' assumption regarding the target runtime. + # + # As a workaround, we use the old full RID graph during the build so that we can continue to use the + # 'win7-x64' and 'win7-x86' RIDs. + $Arguments += "/property:UseRidGraph=true" + } + if ($Options.Runtime -like 'win*' -or ($Options.Runtime -like 'fxdependent*' -and $environment.IsWindows)) { $Arguments += "/property:IsWindows=true" if(!$environment.IsWindows) { @@ -800,6 +811,7 @@ function Restore-PSPackage if ($Options.Runtime -like 'win*') { $RestoreArguments += "/property:EnableWindowsTargeting=True" + $RestoreArguments += "/property:UseRidGraph=True" } if ($InteractiveAuth) { @@ -1197,6 +1209,10 @@ function Publish-PSTestTools { $runtime = $Options.Runtime } + # We are using non-version/distro specific RIDs for test tools, so we need to fix the runtime + # value here if it starts with 'win7'. + $runtime = $runtime -replace '^win7-', 'win-' + Write-Verbose -Verbose -Message "Starting dotnet publish for $toolPath with runtime $runtime" dotnet publish --output bin --configuration $Options.Configuration --framework $Options.Framework --runtime $runtime --self-contained | Out-String | Write-Verbose -Verbose diff --git a/global.json b/global.json index 4ba67068e2a..1c036716cc1 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.100-preview.7.23376.3" + "version": "8.0.100-rc.1.23455.8" } } diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj index e1bc0cf95e3..d85cf9797dc 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj @@ -8,7 +8,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 500e3e2fbf5..a76c7cd3dc9 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 7658d48c8f1..9e71d3ebd6c 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,9 +32,9 @@ - - - + + + 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 9d3f8e6cb61..2e0f4153b04 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 f87b369b668..16b011fc4ee 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -19,9 +19,9 @@ - - - + + + - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index 0aee6a78fed..bacaa026f30 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/ResGen/ResGen.csproj b/src/ResGen/ResGen.csproj index 5174826b96f..6fc2ebd22bf 100644 --- a/src/ResGen/ResGen.csproj +++ b/src/ResGen/ResGen.csproj @@ -7,7 +7,7 @@ Exe true true - win7-x86;win7-x64;osx-x64;linux-x64 + win-x86;win-x64;osx-x64;linux-x64 diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 281162df4c7..b33f4a8c045 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -34,16 +34,16 @@ - - - - + + + + - + - - - + + + diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index 5222f2f53ba..e9eea85d2ce 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -8451,8 +8451,7 @@ public TypeName(IScriptExtent extent, string name) throw PSTraceSource.NewArgumentException(nameof(name)); } - int backtick = name.IndexOf('`'); - if (backtick != -1) + if (name.Contains('`')) { name = name.Replace("``", "`"); } diff --git a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs index 7c32733bb1f..c633fd9fe5c 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs @@ -203,7 +203,7 @@ internal string GetMessage(string resourceString, params object[] args) /// /// Default shellname. /// - protected const string DefaultPowerShellRemoteShellName = System.Management.Automation.Remoting.Client.WSManNativeApi.ResourceURIPrefix + "Microsoft.PowerShell"; + protected const string DefaultPowerShellRemoteShellName = WSManNativeApi.ResourceURIPrefix + "Microsoft.PowerShell"; /// /// Default application name for the connection uri. @@ -3940,9 +3940,9 @@ internal Collection GetDisconnectedSessions(Collection diff --git a/src/TypeCatalogGen/TypeCatalogGen.csproj b/src/TypeCatalogGen/TypeCatalogGen.csproj index 2ccfc7f45c1..f475ae83345 100644 --- a/src/TypeCatalogGen/TypeCatalogGen.csproj +++ b/src/TypeCatalogGen/TypeCatalogGen.csproj @@ -8,7 +8,7 @@ Exe true true - win7-x86;win7-x64;osx-x64;linux-x64 + win-x86;win-x64;osx-x64;linux-x64 diff --git a/test/hosting/hosting.tests.csproj b/test/hosting/hosting.tests.csproj index 3a73e139318..cb72e0a90ef 100644 --- a/test/hosting/hosting.tests.csproj +++ b/test/hosting/hosting.tests.csproj @@ -5,7 +5,6 @@ PowerShell hosting SDK xUnit Tests powershell-hosting-tests - diff --git a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj index f9b90d2ada6..0956c4122c7 100644 --- a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj +++ b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj b/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj index 7d9a355baf9..0fc80386919 100644 --- a/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj +++ b/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj @@ -9,7 +9,7 @@ - + diff --git a/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj b/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj index 01d397df9e0..6dcec1060f1 100644 --- a/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj +++ b/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj @@ -15,6 +15,6 @@ - + diff --git a/test/tools/TestExe/TestExe.csproj b/test/tools/TestExe/TestExe.csproj index 8eec2019df3..2e9ad01d104 100644 --- a/test/tools/TestExe/TestExe.csproj +++ b/test/tools/TestExe/TestExe.csproj @@ -8,7 +8,7 @@ Exe true true - win7-x86;win7-x64;osx-x64;linux-x64 + win-x86;win-x64;osx-x64;linux-x64 diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index 6db00b25e95..d1298eed38a 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -9,11 +9,11 @@ Exe true true - win7-x86;win7-x64 + win-x86;win-x64 - + diff --git a/test/tools/UnixSocket/UnixSocket.csproj b/test/tools/UnixSocket/UnixSocket.csproj index a4143270c8c..e8a177bd20f 100644 --- a/test/tools/UnixSocket/UnixSocket.csproj +++ b/test/tools/UnixSocket/UnixSocket.csproj @@ -8,7 +8,7 @@ Exe true true - win7-x86;win7-x64;osx-x64;linux-x64 + win-x86;win-x64;osx-x64;linux-x64 diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 8d52ef0275d..6068ea71a65 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/test/xUnit/xUnit.tests.csproj b/test/xUnit/xUnit.tests.csproj index 577150aba25..afcd685f5ee 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -6,7 +6,7 @@ PowerShell xUnit Tests powershell-tests true - win7-x86;win7-x64;osx-x64;linux-x64 + win-x86;win-x64;osx-x64;linux-x64 From bcfdb27f6a607859392d1b008f65715babbcd9e7 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 12:30:10 -0700 Subject: [PATCH 0031/1168] [release/v7.4.0-preview.6] Revert changes to continue using `BinaryFormatter` for `Out-GridView` (#20300) (#20360) --- .../FilterRules/ComparableValueFilterRule.cs | 14 +---------- .../FilterRules/DoesNotEqualFilterRule.cs | 15 +---------- .../FilterRules/EqualsFilterRule.cs | 15 +---------- .../FilterCore/FilterRules/FilterRule.cs | 7 +----- .../FilterRules/FilterRuleExtensions.cs | 25 ++++++++++++++++++- .../FilterRules/IsBetweenFilterRule.cs | 16 +----------- .../FilterRules/IsEmptyFilterRule.cs | 13 +--------- .../FilterRules/IsGreaterThanFilterRule.cs | 15 +---------- .../FilterRules/IsLessThanFilterRule.cs | 15 +---------- .../FilterRules/IsNotEmptyFilterRule.cs | 13 +--------- .../FilterRules/IsNotEmptyValidationRule.cs | 1 + .../PropertiesTextContainsFilterRule.cs | 15 +---------- .../PropertyValueSelectorFilterRule.cs | 17 +------------ .../FilterRules/SelectorFilterRule.cs | 18 +------------ .../SingleValueComparableValueFilterRule.cs | 10 +------- .../FilterRules/TextContainsFilterRule.cs | 15 +---------- .../TextDoesNotContainFilterRule.cs | 15 +---------- .../FilterRules/TextDoesNotEqualFilterRule.cs | 15 +---------- .../FilterRules/TextEndsWithFilterRule.cs | 15 +---------- .../FilterRules/TextEqualsFilterRule.cs | 15 +---------- .../FilterCore/FilterRules/TextFilterRule.cs | 12 +-------- .../FilterRules/TextStartsWithFilterRule.cs | 12 +-------- .../FilterCore/ValidatingSelectorValue.cs | 1 + .../FilterCore/ValidatingValue.cs | 1 + .../FilterCore/ValidatingValueBase.cs | 1 + .../DataErrorInfoValidationRule.cs | 1 + .../FilterRuleToDisplayNameConverter.cs | 1 + .../ManagementListStateDescriptor.cs | 1 + .../powershell-win-core.csproj | 1 + 29 files changed, 52 insertions(+), 263 deletions(-) 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 9e6329e20ae..e7ef648e3fe 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/ComparableValueFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/ComparableValueFilterRule.cs @@ -13,6 +13,7 @@ namespace Microsoft.Management.UI.Internal /// The generic parameter. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public abstract class ComparableValueFilterRule : FilterRule where T : IComparable { #region Properties @@ -61,19 +62,6 @@ public override bool Evaluate(object item) return this.Evaluate(castItem); } - /// - /// Creates a clone of the ComparableValueFilterRule instance. - /// - /// - /// Returns a clone of the ComparableValueFilterRule instance. - /// - public override FilterRule Clone() - { - ComparableValueFilterRule rule = (ComparableValueFilterRule)Activator.CreateInstance(this.GetType()); - rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation; - return rule; - } - /// /// Determines if item matches a derived classes criteria. /// 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 d616d9f5baa..ae209d0e60f 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/DoesNotEqualFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/DoesNotEqualFilterRule.cs @@ -13,6 +13,7 @@ namespace Microsoft.Management.UI.Internal /// The generic parameter. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class DoesNotEqualFilterRule : EqualsFilterRule where T : IComparable { /// @@ -24,20 +25,6 @@ public DoesNotEqualFilterRule() this.DefaultNullValueEvaluation = true; } - /// - /// Creates a clone of the DoesNotEqualFilterRule instance. - /// - /// - /// A clone of the DoesNotEqualFilterRule instance. - /// - public override FilterRule Clone() - { - DoesNotEqualFilterRule rule = new DoesNotEqualFilterRule(); - rule.Value = this.Value; - rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation; - return rule; - } - /// /// Determines if item is not equal to Value. /// 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 a8a17627306..7bafd53e411 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/EqualsFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/EqualsFilterRule.cs @@ -14,6 +14,7 @@ namespace Microsoft.Management.UI.Internal /// The generic parameter. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class EqualsFilterRule : SingleValueComparableValueFilterRule where T : IComparable { /// @@ -24,20 +25,6 @@ public EqualsFilterRule() this.DisplayName = UICultureResources.FilterRule_Equals; } - /// - /// Creates a new EqualsFilterRule that is a clone of the current instance. - /// - /// - /// A new EqualsFilterRule that is a clone of the current instance. - /// - public override FilterRule Clone() - { - EqualsFilterRule rule = new EqualsFilterRule(); - rule.Value = this.Value; - rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation; - return rule; - } - /// /// Determines if item is equal to Value. /// 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 b7eec639466..e7717c9a7b8 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRule.cs @@ -10,6 +10,7 @@ namespace Microsoft.Management.UI.Internal /// The base class for all filtering rules. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public abstract class FilterRule : IEvaluate { /// @@ -48,12 +49,6 @@ protected FilterRule() /// Returns true if the item meets the criteria. False otherwise. public abstract bool Evaluate(object item); - /// - /// Creates a clone of this FilterRule. - /// - /// Returns a clone of this FilterRule. - public abstract FilterRule Clone(); - #region EvaluationResultInvalidated /// 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 845d35dd95f..bc8e0b02ca6 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs @@ -27,7 +27,30 @@ public static class FilterRuleExtensions /// public static FilterRule DeepCopy(this FilterRule rule) { - return rule.Clone(); + ArgumentNullException.ThrowIfNull(rule); + +#pragma warning disable SYSLIB0050 + Debug.Assert(rule.GetType().IsSerializable, "rule is serializable"); +#pragma warning disable SYSLIB0011 + BinaryFormatter formatter = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.Clone)); +#pragma warning restore SYSLIB0011 + MemoryStream ms = new MemoryStream(); + + FilterRule copy = null; + try + { + formatter.Serialize(ms, rule); + + ms.Position = 0; + copy = (FilterRule)formatter.Deserialize(ms); +#pragma warning restore SYSLIB0050 + } + finally + { + ms.Close(); + } + + return copy; } } } 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 597bafb6db0..cbe4a875dd0 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsBetweenFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsBetweenFilterRule.cs @@ -16,6 +16,7 @@ namespace Microsoft.Management.UI.Internal /// The generic parameter. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class IsBetweenFilterRule : ComparableValueFilterRule where T : IComparable { #region Properties @@ -50,21 +51,6 @@ public ValidatingValue EndValue protected set; } - /// - /// Creates a clone of the FilterRule. - /// - /// - /// A clone of the FilterRule. - /// - public override FilterRule Clone() - { - IsBetweenFilterRule clone = new IsBetweenFilterRule(); - clone.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation; - clone.StartValue = this.StartValue; - clone.EndValue = this.EndValue; - return clone; - } - #endregion Properties #region Ctor 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 d523409e53a..5ad2ae1247e 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsEmptyFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsEmptyFilterRule.cs @@ -10,6 +10,7 @@ namespace Microsoft.Management.UI.Internal /// is empty or not. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class IsEmptyFilterRule : FilterRule { /// @@ -20,18 +21,6 @@ public IsEmptyFilterRule() this.DisplayName = UICultureResources.FilterRule_IsEmpty; } - /// - /// Creates a clone of the IsEmptyFilterRule instance. - /// - /// - /// A clone of IsEmptyFilterRule instance. - /// - public override FilterRule Clone() - { - IsEmptyFilterRule rule = new IsEmptyFilterRule(); - return rule; - } - /// /// Gets a values indicating whether the supplied item is empty. /// 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 e2cea2d4885..d098d2a9383 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsGreaterThanFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsGreaterThanFilterRule.cs @@ -14,6 +14,7 @@ namespace Microsoft.Management.UI.Internal /// The generic parameter. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class IsGreaterThanFilterRule : SingleValueComparableValueFilterRule where T : IComparable { /// @@ -24,20 +25,6 @@ public IsGreaterThanFilterRule() this.DisplayName = UICultureResources.FilterRule_GreaterThanOrEqual; } - /// - /// Creates a new IsGreaterThanFilterRule that is a clone of the current instance. - /// - /// - /// A new IsGreaterThanFilterRule that is a clone of the current instance. - /// - public override FilterRule Clone() - { - IsGreaterThanFilterRule rule = new IsGreaterThanFilterRule(); - rule.Value = this.Value; - rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation; - return rule; - } - /// /// Determines if item is greater than Value. /// 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 905d14648c3..8539d6edf0e 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsLessThanFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsLessThanFilterRule.cs @@ -14,6 +14,7 @@ namespace Microsoft.Management.UI.Internal /// The generic parameter. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class IsLessThanFilterRule : SingleValueComparableValueFilterRule where T : IComparable { /// @@ -24,20 +25,6 @@ public IsLessThanFilterRule() this.DisplayName = UICultureResources.FilterRule_LessThanOrEqual; } - /// - /// Creates a new IsLessThanFilterRule that is a clone of the current instance. - /// - /// - /// A new IsLessThanFilterRule that is a clone of the current instance. - /// - public override FilterRule Clone() - { - IsLessThanFilterRule rule = new IsLessThanFilterRule(); - rule.Value = this.Value; - rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation; - return rule; - } - /// /// Determines if item is less than Value. /// 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 b6410917e94..68e501d1f68 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyFilterRule.cs @@ -10,6 +10,7 @@ namespace Microsoft.Management.UI.Internal /// is empty or not. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class IsNotEmptyFilterRule : IsEmptyFilterRule { /// @@ -20,18 +21,6 @@ public IsNotEmptyFilterRule() this.DisplayName = UICultureResources.FilterRule_IsNotEmpty; } - /// - /// Creates a clone of the IsNotEmptyFilterRule. - /// - /// - /// A clone of the IsNotEmptyFilterRule. - /// - public override FilterRule Clone() - { - IsNotEmptyFilterRule rule = new IsNotEmptyFilterRule(); - return rule; - } - /// /// Gets a values indicating whether the supplied item is not empty. /// 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 83734f42f76..31722bfe1f7 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyValidationRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyValidationRule.cs @@ -9,6 +9,7 @@ namespace Microsoft.Management.UI.Internal /// The IsNotEmptyValidationRule checks a value to see if a value is not empty. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class IsNotEmptyValidationRule : DataErrorInfoValidationRule { #region Properties 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 e1be855825e..2a1cc576b39 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertiesTextContainsFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertiesTextContainsFilterRule.cs @@ -12,6 +12,7 @@ namespace Microsoft.Management.UI.Internal /// Represents a filter rule that searches for text within properties on an object. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class PropertiesTextContainsFilterRule : TextFilterRule { private static readonly string TextContainsCharactersRegexPattern = "{0}"; @@ -37,20 +38,6 @@ public ICollection PropertyNames private set; } - /// - /// Creates a clone of this . - /// - /// - /// A clone of this . - /// - public override FilterRule Clone() - { - PropertiesTextContainsFilterRule clone = new PropertiesTextContainsFilterRule(); - clone.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation; - clone.PropertyNames = new List(this.PropertyNames); - return clone; - } - /// /// Evaluates whether the specified properties on contain the current value. /// 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 551ae38d453..158ab4e0229 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertyValueSelectorFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertyValueSelectorFilterRule.cs @@ -16,6 +16,7 @@ namespace Microsoft.Management.UI.Internal /// The generic parameter. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class PropertyValueSelectorFilterRule : SelectorFilterRule where T : IComparable { #region Properties @@ -65,11 +66,6 @@ public PropertyValueSelectorFilterRule(string propertyName, string propertyDispl /// public PropertyValueSelectorFilterRule(string propertyName, string propertyDisplayName, IEnumerable rules) { - ArgumentException.ThrowIfNullOrEmpty(propertyName); - ArgumentException.ThrowIfNullOrEmpty(propertyDisplayName); - - ArgumentNullException.ThrowIfNull(rules); - this.PropertyName = propertyName; this.DisplayName = propertyDisplayName; @@ -120,17 +116,6 @@ public override bool Evaluate(object item) return this.AvailableRules.SelectedValue.Evaluate(propertyValue); } - /// - /// Creates a clone of the PropertyValueSelectorFilterRule instance. - /// - /// - /// Returns a clone of the PropertyValueSelectorFilterRule instance. - /// - public override FilterRule Clone() - { - return new PropertyValueSelectorFilterRule(this.PropertyName, this.DisplayName, this.AvailableRules.AvailableValues); - } - #endregion Public Methods #region Private Methods 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 6f0042cb48e..da4a62b6f66 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SelectorFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SelectorFilterRule.cs @@ -10,6 +10,7 @@ namespace Microsoft.Management.UI.Internal /// The SelectorFilterRule represents a rule composed of other rules. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class SelectorFilterRule : FilterRule { #region Properties @@ -70,23 +71,6 @@ public override bool Evaluate(object item) return this.AvailableRules.SelectedValue.Evaluate(item); } - /// - /// Creates a clone of the SelectorFilterRule instance. - /// - /// - /// Returns a clone of the SelectorFilterRule instance. - /// - public override FilterRule Clone() - { - SelectorFilterRule clone = new SelectorFilterRule(); - clone.DisplayName = this.DisplayName; - clone.AvailableRules = this.AvailableRules; - clone.AvailableRules.SelectedValueChanged += clone.AvailableRules_SelectedValueChanged; - clone.AvailableRules.SelectedValue.EvaluationResultInvalidated += clone.SelectedValue_EvaluationResultInvalidated; - - return clone; - } - /// /// Called when the SelectedValue within AvailableRules changes. /// 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 e716369cb20..9486a126820 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SingleValueComparableValueFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SingleValueComparableValueFilterRule.cs @@ -13,6 +13,7 @@ namespace Microsoft.Management.UI.Internal /// /// The generic parameter. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public abstract class SingleValueComparableValueFilterRule : ComparableValueFilterRule where T : IComparable { #region Properties @@ -53,15 +54,6 @@ protected SingleValueComparableValueFilterRule() #endregion Ctor - /// - /// Creates a clone of the FilterRule. - /// - /// A clone of the FilterRule. - public override FilterRule Clone() - { - return base.Clone(); - } - private void Value_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "Value") 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 db3a6e57e28..fe581ca2031 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextContainsFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextContainsFilterRule.cs @@ -11,6 +11,7 @@ namespace Microsoft.Management.UI.Internal /// check if it is contains the rule's value within it. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class TextContainsFilterRule : TextFilterRule { private static readonly string TextContainsCharactersRegexPattern = "{0}"; @@ -24,20 +25,6 @@ public TextContainsFilterRule() this.DisplayName = UICultureResources.FilterRule_Contains; } - /// - /// Creates a clone of the TextContainsFilterRule instance. - /// - /// - /// Returns a clone of the TextContainsFilterRule instance. - /// - public override FilterRule Clone() - { - TextContainsFilterRule rule = new TextContainsFilterRule(); - rule.Value = this.Value; - rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation; - return rule; - } - /// /// Determines if Value is contained within data. /// 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 e211d4ca8bd..29bec9b4bbf 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotContainFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotContainFilterRule.cs @@ -10,6 +10,7 @@ namespace Microsoft.Management.UI.Internal /// check if it is does not contain the rule's value within it. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class TextDoesNotContainFilterRule : TextContainsFilterRule { /// @@ -21,20 +22,6 @@ public TextDoesNotContainFilterRule() this.DefaultNullValueEvaluation = true; } - /// - /// Creates a clone of the TextDoesNotContainFilterRule instance. - /// - /// - /// A clone of the TextDoesNotContainFilterRule instance. - /// - public override FilterRule Clone() - { - TextDoesNotContainFilterRule rule = new TextDoesNotContainFilterRule(); - rule.Value = this.Value; - rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation; - return rule; - } - /// /// Determines if Value is not contained within data. /// 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 f3a8d5353a9..4e72fe16e67 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotEqualFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotEqualFilterRule.cs @@ -10,6 +10,7 @@ namespace Microsoft.Management.UI.Internal /// check if it is not equal to the rule's value. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class TextDoesNotEqualFilterRule : TextEqualsFilterRule { /// @@ -21,20 +22,6 @@ public TextDoesNotEqualFilterRule() this.DefaultNullValueEvaluation = true; } - /// - /// Creates a clone of the TextDoesNotEqualFilterRule instance. - /// - /// - /// Returns a clone of the TextDoesNotEqualFilterRule instance. - /// - public override FilterRule Clone() - { - TextDoesNotEqualFilterRule rule = new TextDoesNotEqualFilterRule(); - rule.Value = this.Value; - rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation; - return rule; - } - /// /// Determines if data is not equal to Value. /// 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 b1ef79bc6b4..baca67801bf 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEndsWithFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEndsWithFilterRule.cs @@ -11,6 +11,7 @@ namespace Microsoft.Management.UI.Internal /// check if it ends with the rule's value. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class TextEndsWithFilterRule : TextFilterRule { private static readonly string TextEndsWithCharactersRegexPattern = "{0}$"; @@ -24,20 +25,6 @@ public TextEndsWithFilterRule() this.DisplayName = UICultureResources.FilterRule_TextEndsWith; } - /// - /// Creates a clone of the TextEndsWithFilterRule instance. - /// - /// - /// Returns a clone of the TextEndsWithFilterRule instance. - /// - public override FilterRule Clone() - { - TextEndsWithFilterRule rule = new TextEndsWithFilterRule(); - rule.Value = this.Value; - rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation; - return rule; - } - /// /// Determines if data ends with Value. /// 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 5c296dc2037..e49dd9b4a0d 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEqualsFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEqualsFilterRule.cs @@ -11,6 +11,7 @@ namespace Microsoft.Management.UI.Internal /// check if it is equal to the rule's value. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class TextEqualsFilterRule : TextFilterRule { private static readonly string TextEqualsCharactersRegexPattern = "^{0}$"; @@ -23,20 +24,6 @@ public TextEqualsFilterRule() this.DisplayName = UICultureResources.FilterRule_Equals; } - /// - /// Creates a clone of the TextEqualsFilterRule instance. - /// - /// - /// Returns a clone of the TextEqualsFilterRule instance. - /// - public override FilterRule Clone() - { - TextEqualsFilterRule rule = new TextEqualsFilterRule(); - rule.Value = this.Value; - rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation; - return rule; - } - /// /// Determines if data is equal to Value. /// 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 b2ab66a0db3..0dc75cf24e4 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextFilterRule.cs @@ -14,6 +14,7 @@ namespace Microsoft.Management.UI.Internal /// evaluating string operations. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public abstract class TextFilterRule : SingleValueComparableValueFilterRule { /// @@ -60,17 +61,6 @@ public bool CultureInvariant } } - /// - /// Creates a clone of the FilterRule. - /// - /// - /// Returns a clone of the FilterRule. - /// - public override FilterRule Clone() - { - return base.Clone(); - } - /// /// Initializes a new instance of the TextFilterRule class. /// 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 d04079ee012..e97deb0fd46 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextStartsWithFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextStartsWithFilterRule.cs @@ -11,6 +11,7 @@ namespace Microsoft.Management.UI.Internal /// check if it starts with the rule's value. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class TextStartsWithFilterRule : TextFilterRule { private static readonly string TextStartsWithCharactersRegexPattern = "^{0}"; @@ -24,17 +25,6 @@ public TextStartsWithFilterRule() this.DisplayName = UICultureResources.FilterRule_TextStartsWith; } - /// - /// Creates a clone of the TextStartsWithFilterRule instance. - /// - /// - /// Returns a clone of the TextStartsWithFilterRule instance. - /// - public override FilterRule Clone() - { - return base.Clone(); - } - /// /// Determines if data starts with Value. /// diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingSelectorValue.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingSelectorValue.cs index 5f21c186bee..f8583e98bc8 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingSelectorValue.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingSelectorValue.cs @@ -17,6 +17,7 @@ namespace Microsoft.Management.UI.Internal /// The generic parameter. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class ValidatingSelectorValue : ValidatingValueBase { #region Properties diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValue.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValue.cs index 49f16407318..fe21d2fee37 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValue.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValue.cs @@ -15,6 +15,7 @@ namespace Microsoft.Management.UI.Internal /// The generic parameter. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class ValidatingValue : ValidatingValueBase { #region Properties diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValueBase.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValueBase.cs index 0ead40919da..be7584f0ffb 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValueBase.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValueBase.cs @@ -16,6 +16,7 @@ namespace Microsoft.Management.UI.Internal /// classes to support validation via the IDataErrorInfo interface. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public abstract class ValidatingValueBase : IDataErrorInfo, INotifyPropertyChanged { #region Properties 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 162de593a88..652592aec04 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidationRules/DataErrorInfoValidationRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidationRules/DataErrorInfoValidationRule.cs @@ -9,6 +9,7 @@ namespace Microsoft.Management.UI.Internal /// Provides a way to create a custom rule in order to check the validity of user input. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public abstract class DataErrorInfoValidationRule { /// diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleToDisplayNameConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleToDisplayNameConverter.cs index 972c19080e0..aaca30ff321 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleToDisplayNameConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleToDisplayNameConverter.cs @@ -12,6 +12,7 @@ namespace Microsoft.Management.UI.Internal /// a FilterRule value to its DisplayName. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class FilterRuleToDisplayNameConverter : IValueConverter { /// diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptor.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptor.cs index 9798804bd80..45db449d705 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptor.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptor.cs @@ -16,6 +16,7 @@ namespace Microsoft.Management.UI.Internal /// Allows the state of the ManagementList to be saved and restored. /// [SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] + [Serializable] public class ManagementListStateDescriptor : StateDescriptor { #region Fields diff --git a/src/powershell-win-core/powershell-win-core.csproj b/src/powershell-win-core/powershell-win-core.csproj index 79d9e3fccfa..87a8221a689 100644 --- a/src/powershell-win-core/powershell-win-core.csproj +++ b/src/powershell-win-core/powershell-win-core.csproj @@ -13,6 +13,7 @@ ..\..\assets\pwsh.manifest Windows 8.0 + true From 769a039c43c9bec3d9426e928176e0af76bf669a Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 13:09:39 -0700 Subject: [PATCH 0032/1168] [release/v7.4.0-preview.6] Update `Microsoft.PowerShell.PSResourceGet` to 0.9.0-rc1 (#20274) (#20361) --- 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 f7abd35a6f7..a96bac9f64d 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -13,7 +13,7 @@ - + From a092dad7c09c0b2cc5f37c7bec2701279767e85a Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 13:10:28 -0700 Subject: [PATCH 0033/1168] [release/v7.4.0-preview.6] Set experimental features to stable for 7.4 release (#20285) (#20362) --- .../common/FormatViewGenerator_Table.cs | 2 +- .../engine/BytePipe.cs | 4 +- .../ExperimentalFeature.cs | 20 ------ .../engine/InitialSessionState.cs | 27 +++----- .../engine/NativeCommandProcessor.cs | 66 +++++++------------ .../engine/pipeline.cs | 33 ++++------ .../engine/runtime/Operations/MiscOps.cs | 22 +++---- .../Basic/NativeCommandBytePiping.Tests.ps1 | 5 -- .../NativeCommandErrorHandling.Tests.ps1 | 6 -- 9 files changed, 55 insertions(+), 130 deletions(-) diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs index 442603b448e..64ed5bad6cf 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs @@ -173,7 +173,7 @@ private TableHeaderInfo GenerateTableHeaderInfoFromDataBaseInfo(PSObject so) ci.alignment = colHeader.alignment; if (colHeader.label != null) { - ci.HeaderMatchesProperty = so.Properties[colHeader.label.text] is not null || !ExperimentalFeature.IsEnabled(ExperimentalFeature.PSCustomTableHeaderLabelDecoration); + ci.HeaderMatchesProperty = so.Properties[colHeader.label.text] is not null; ci.label = this.dataBaseInfo.db.displayResourceManagerCache.GetTextTokenString(colHeader.label); } diff --git a/src/System.Management.Automation/engine/BytePipe.cs b/src/System.Management.Automation/engine/BytePipe.cs index 3d4832d6043..03eb827df98 100644 --- a/src/System.Management.Automation/engine/BytePipe.cs +++ b/src/System.Management.Automation/engine/BytePipe.cs @@ -104,9 +104,7 @@ internal static FileBytePipe Create(string fileName, bool append) throw new RuntimeException(null, e, errorRecord); } - ApplicationInsightsTelemetry.SendExperimentalUseData( - ExperimentalFeature.PSNativeCommandPreserveBytePipe, - "f"); + ApplicationInsightsTelemetry.SendExperimentalUseData("PSNativeCommandPreserveBytePipe", "f"); return new FileBytePipe(fileStream); } diff --git a/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs b/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs index 45f8c98e7a0..25d9b6e2743 100644 --- a/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs +++ b/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs @@ -21,14 +21,9 @@ public class ExperimentalFeature #region Const Members internal const string EngineSource = "PSEngine"; - internal const string PSNativeCommandErrorActionPreferenceFeatureName = "PSNativeCommandErrorActionPreference"; - internal const string PSNativeCommandPreserveBytePipe = "PSNativeCommandPreserveBytePipe"; internal const string PSModuleAutoLoadSkipOfflineFilesFeatureName = "PSModuleAutoLoadSkipOfflineFiles"; - internal const string PSCustomTableHeaderLabelDecoration = "PSCustomTableHeaderLabelDecoration"; internal const string PSFeedbackProvider = "PSFeedbackProvider"; internal const string PSCommandWithArgs = "PSCommandWithArgs"; - internal const string PSConstrainedAuditLogging = "PSConstrainedAuditLogging"; - internal const string PSWindowsNativeCommandArgPassing = "PSWindowsNativeCommandArgPassing"; #endregion @@ -120,30 +115,15 @@ static ExperimentalFeature() new ExperimentalFeature( name: "PSLoadAssemblyFromNativeCode", description: "Expose an API to allow assembly loading from native code"), - new ExperimentalFeature( - name: PSNativeCommandErrorActionPreferenceFeatureName, - description: "Native commands with non-zero exit codes issue errors according to $ErrorActionPreference when $PSNativeCommandUseErrorActionPreference is $true"), new ExperimentalFeature( name: PSModuleAutoLoadSkipOfflineFilesFeatureName, description: "Module discovery will skip over files that are marked by cloud providers as not fully on disk."), - new ExperimentalFeature( - name: PSCustomTableHeaderLabelDecoration, - description: "Formatting differentiation for table header labels that aren't property members"), - new ExperimentalFeature( - name: PSNativeCommandPreserveBytePipe, - description: "Byte output is retained when piping between two or more native commands"), new ExperimentalFeature( name: PSFeedbackProvider, description: "Replace the hard-coded suggestion framework with the extensible feedback provider"), new ExperimentalFeature( name: PSCommandWithArgs, description: "Enable `-CommandWithArgs` parameter for pwsh"), - new ExperimentalFeature( - name: PSConstrainedAuditLogging, - description: "PowerShell restriction logging when WDAC (Windows Defender Application Control) Code Integrity policy is set to Audit mode."), - new ExperimentalFeature( - name: "PSWindowsNativeCommandArgPassing", - description: "Enable 'Windows' as the native command argument passing mode"), }; EngineExperimentalFeatures = new ReadOnlyCollection(engineFeatures); diff --git a/src/System.Management.Automation/engine/InitialSessionState.cs b/src/System.Management.Automation/engine/InitialSessionState.cs index d367f4eb106..0a2d3fa74df 100644 --- a/src/System.Management.Automation/engine/InitialSessionState.cs +++ b/src/System.Management.Automation/engine/InitialSessionState.cs @@ -4652,16 +4652,13 @@ static InitialSessionState() #endregion }; - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandErrorActionPreferenceFeatureName)) - { - builtinVariables.Add( - new SessionStateVariableEntry( - SpecialVariables.PSNativeCommandUseErrorActionPreference, - value: true, // when this feature is changed to stable, this should default to `false` - RunspaceInit.PSNativeCommandUseErrorActionPreferenceDescription, - ScopedItemOptions.None, - new ArgumentTypeConverterAttribute(typeof(bool)))); - } + builtinVariables.Add( + new SessionStateVariableEntry( + SpecialVariables.PSNativeCommandUseErrorActionPreference, + value: false, + RunspaceInit.PSNativeCommandUseErrorActionPreferenceDescription, + ScopedItemOptions.None, + new ArgumentTypeConverterAttribute(typeof(bool)))); builtinVariables.Add( new SessionStateVariableEntry( @@ -4677,20 +4674,14 @@ static InitialSessionState() /// /// Assigns the default behavior for native argument passing. /// If the system is non-Windows, we will return Standard. - /// If the experimental feature is enabled, we will return Windows. - /// Otherwise, we will return Legacy. + /// Otherwise, we will return Windows. /// private static NativeArgumentPassingStyle GetPassingStyle() { #if UNIX return NativeArgumentPassingStyle.Standard; #else - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSWindowsNativeCommandArgPassing)) - { - return NativeArgumentPassingStyle.Windows; - } - - return NativeArgumentPassingStyle.Legacy; + return NativeArgumentPassingStyle.Windows; #endif } diff --git a/src/System.Management.Automation/engine/NativeCommandProcessor.cs b/src/System.Management.Automation/engine/NativeCommandProcessor.cs index 326e96dfac8..85b675a9ae9 100644 --- a/src/System.Management.Automation/engine/NativeCommandProcessor.cs +++ b/src/System.Management.Automation/engine/NativeCommandProcessor.cs @@ -397,8 +397,7 @@ internal override void ProcessRecord() { // If upstream is a native command it'll be writing directly to our stdin stream // so we can skip reading here. - if (!ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - || !UpstreamIsNativeCommand) + if (!UpstreamIsNativeCommand) { while (Read()) { @@ -547,7 +546,7 @@ private void InitNativeProcess() // Send Telemetry indicating what argument passing mode we are in. ApplicationInsightsTelemetry.SendExperimentalUseData( - ExperimentalFeature.PSWindowsNativeCommandArgPassing, + "PSWindowsNativeCommandArgPassing", NativeParameterBinderController.ArgumentPassingStyle.ToString()); #if !UNIX @@ -720,9 +719,7 @@ private void InitNativeProcess() lock (_sync) { - if (!_stopped - && (!ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - || !UpstreamIsNativeCommand)) + if (!_stopped && !UpstreamIsNativeCommand) { _inputWriter.Start(_nativeProcess, inputFormat); } @@ -785,21 +782,16 @@ private void InitOutputQueue() if (CommandRuntime.ErrorMergeTo is MshCommandRuntime.MergeDataStream.Output) { StdOutDestination = null; - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe)) + if (DownStreamNativeCommand is not null) { - if (DownStreamNativeCommand is not null) - { - DownStreamNativeCommand.UpstreamIsNativeCommand = false; - DownStreamNativeCommand = null; - } + DownStreamNativeCommand.UpstreamIsNativeCommand = false; + DownStreamNativeCommand = null; } } _nativeProcessOutputQueue = new BlockingCollection(); // we don't assign the handler to anything, because it's used only for objects marshaling - BytePipe stdOutDestination = ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - ? StdOutDestination ?? DownStreamNativeCommand?.CreateBytePipe(stdout: false) - : null; + BytePipe stdOutDestination = StdOutDestination ?? DownStreamNativeCommand?.CreateBytePipe(stdout: false); BytePipe stdOutSource = null; if (stdOutDestination is not null) @@ -823,8 +815,7 @@ private ProcessOutputObject DequeueProcessOutput(bool blocking) { if (blocking) { - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - && _stdOutByteTransfer is not null) + if (_stdOutByteTransfer is not null) { _stdOutByteTransfer.EOF.GetAwaiter().GetResult(); return null; @@ -853,8 +844,7 @@ private ProcessOutputObject DequeueProcessOutput(bool blocking) } else { - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - && _stdOutByteTransfer is not null) + if (_stdOutByteTransfer is not null) { return null; } @@ -897,8 +887,7 @@ internal override void Complete() if (!_isRunningInBackground) { // Wait for input writer to finish. - if (!ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - || !UpstreamIsNativeCommand) + if (!UpstreamIsNativeCommand) { _inputWriter.Done(); } @@ -952,12 +941,6 @@ internal override void Complete() this.commandRuntime.PipelineProcessor.ExecutionFailed = true; - // Feature is not enabled, so return - if (!ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandErrorActionPreferenceFeatureName)) - { - return; - } - // We send telemetry information only if the feature is enabled. // This shouldn't be done once, because it's a run-time check we should send telemetry every time. // Report on the following conditions: @@ -973,12 +956,12 @@ internal override void Complete() // The variable is unset if (useDefaultSetting) { - ApplicationInsightsTelemetry.SendExperimentalUseData(ExperimentalFeature.PSNativeCommandErrorActionPreferenceFeatureName, "unset"); + ApplicationInsightsTelemetry.SendExperimentalUseData("PSNativeCommandErrorActionPreference", "unset"); return; } // Send the value that was set. - ApplicationInsightsTelemetry.SendExperimentalUseData(ExperimentalFeature.PSNativeCommandErrorActionPreferenceFeatureName, nativeErrorActionPreferenceSetting.ToString()); + ApplicationInsightsTelemetry.SendExperimentalUseData("PSNativeCommandErrorActionPreference", nativeErrorActionPreferenceSetting.ToString()); // if it was explicitly set to false, return if (!nativeErrorActionPreferenceSetting) @@ -1267,8 +1250,7 @@ internal void StopProcessing() if (!_runStandAlone) { // Stop input writer - if (!ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - || !UpstreamIsNativeCommand) + if (!UpstreamIsNativeCommand) { _inputWriter.Stop(); } @@ -1816,8 +1798,7 @@ public ProcessOutputHandler( return; } - if (!ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - || stdOutDestination is null) + if (stdOutDestination is null) { _isFirstOutput = true; _isXmlCliOutput = false; @@ -2074,19 +2055,16 @@ internal void Add(object input) object baseObjInput = PSObject.Base(input); - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe)) + if (baseObjInput is byte[] bytes) { - if (baseObjInput is byte[] bytes) - { - _streamWriter.BaseStream.Write(bytes, 0, bytes.Length); - return; - } + _streamWriter.BaseStream.Write(bytes, 0, bytes.Length); + return; + } - if (baseObjInput is byte b) - { - _streamWriter.BaseStream.WriteByte(b); - return; - } + if (baseObjInput is byte b) + { + _streamWriter.BaseStream.WriteByte(b); + return; } AddTextInput(input); diff --git a/src/System.Management.Automation/engine/pipeline.cs b/src/System.Management.Automation/engine/pipeline.cs index a045a4f83ff..e19bf3be843 100644 --- a/src/System.Management.Automation/engine/pipeline.cs +++ b/src/System.Management.Automation/engine/pipeline.cs @@ -261,31 +261,26 @@ private void LogToEventLog() /// internal int Add(CommandProcessorBase commandProcessor) { - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe)) + if (commandProcessor is NativeCommandProcessor nativeCommand) { - if (commandProcessor is NativeCommandProcessor nativeCommand) + if (_lastNativeCommand is not null) { - if (_lastNativeCommand is not null) + // Only report experimental feature usage once per pipeline. + if (!_haveReportedNativePipeUsage) { - // Only report experimental feature usage once per pipeline. - if (!_haveReportedNativePipeUsage) - { - ApplicationInsightsTelemetry.SendExperimentalUseData( - ExperimentalFeature.PSNativeCommandPreserveBytePipe, - "p"); - _haveReportedNativePipeUsage = true; - } - - _lastNativeCommand.DownStreamNativeCommand = nativeCommand; - nativeCommand.UpstreamIsNativeCommand = true; + ApplicationInsightsTelemetry.SendExperimentalUseData("PSNativeCommandPreserveBytePipe", "p"); + _haveReportedNativePipeUsage = true; } - _lastNativeCommand = nativeCommand; - } - else - { - _lastNativeCommand = null; + _lastNativeCommand.DownStreamNativeCommand = nativeCommand; + nativeCommand.UpstreamIsNativeCommand = true; } + + _lastNativeCommand = nativeCommand; + } + else + { + _lastNativeCommand = null; } commandProcessor.CommandRuntime.PipelineProcessor = this; diff --git a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs index 583288905c2..eb3100ea512 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs @@ -221,10 +221,7 @@ private static CommandProcessorBase AddCommand(PipelineProcessor pipe, bool redirectedInformation = false; if (redirections != null) { - bool shouldProcessMergesFirst = ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe) - && isNativeCommand; - - if (shouldProcessMergesFirst) + if (isNativeCommand) { foreach (CommandRedirection redirection in redirections) { @@ -237,7 +234,7 @@ private static CommandProcessorBase AddCommand(PipelineProcessor pipe, foreach (CommandRedirection redirection in redirections) { - if (!shouldProcessMergesFirst || redirection is not MergingRedirection) + if (!isNativeCommand || redirection is not MergingRedirection) { redirection.Bind(pipe, commandProcessor, context); } @@ -1081,16 +1078,13 @@ public override string ToString() // dir > out internal override void Bind(PipelineProcessor pipelineProcessor, CommandProcessorBase commandProcessor, ExecutionContext context) { - if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSNativeCommandPreserveBytePipe)) + if (commandProcessor is NativeCommandProcessor nativeCommand + && nativeCommand.CommandRuntime.ErrorMergeTo is not MshCommandRuntime.MergeDataStream.Output + && FromStream is RedirectionStream.Output + && !string.IsNullOrWhiteSpace(File)) { - if (commandProcessor is NativeCommandProcessor nativeCommand - && nativeCommand.CommandRuntime.ErrorMergeTo is not MshCommandRuntime.MergeDataStream.Output - && FromStream is RedirectionStream.Output - && !string.IsNullOrWhiteSpace(File)) - { - nativeCommand.StdOutDestination = FileBytePipe.Create(File, Appending); - return; - } + nativeCommand.StdOutDestination = FileBytePipe.Create(File, Appending); + return; } Pipe pipe = GetRedirectionPipe(context, pipelineProcessor); diff --git a/test/powershell/engine/Basic/NativeCommandBytePiping.Tests.ps1 b/test/powershell/engine/Basic/NativeCommandBytePiping.Tests.ps1 index 1e645df9030..236cbd8c9e6 100644 --- a/test/powershell/engine/Basic/NativeCommandBytePiping.Tests.ps1 +++ b/test/powershell/engine/Basic/NativeCommandBytePiping.Tests.ps1 @@ -8,11 +8,6 @@ Describe 'Native command byte piping tests' -Tags 'CI' { BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() - if (-not [ExperimentalFeature]::IsEnabled('PSNativeCommandPreserveBytePipe')) - { - $PSDefaultParameterValues['It:Skip'] = $true - return - } # Without this the test would otherwise be hard coded to a specific set # of [Console]::OutputEncoding/$OutputEncoding settings. diff --git a/test/powershell/engine/Basic/NativeCommandErrorHandling.Tests.ps1 b/test/powershell/engine/Basic/NativeCommandErrorHandling.Tests.ps1 index 055382bb5e1..8122e598d2c 100644 --- a/test/powershell/engine/Basic/NativeCommandErrorHandling.Tests.ps1 +++ b/test/powershell/engine/Basic/NativeCommandErrorHandling.Tests.ps1 @@ -7,12 +7,6 @@ Describe 'Native command error handling tests' -Tags 'CI' { BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() - if (-not [ExperimentalFeature]::IsEnabled('PSNativeCommandErrorActionPreference')) - { - $PSDefaultParameterValues['It:Skip'] = $true - return - } - $exeName = $IsWindows ? 'testexe.exe' : 'testexe' $exePath = @(Get-Command $exeName -Type Application)[0].Path From 14f0809164198f030ad40291ac9b201270499f04 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 13:11:34 -0700 Subject: [PATCH 0034/1168] [release/v7.4.0-preview.6] Bump `XunitXml.TestLogger` from 3.1.11 to 3.1.17 (#20293) (#20364) --- 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 afcd685f5ee..8e1b52c7a8c 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -26,7 +26,7 @@ - + From 4c096ce7ed7c605a4c0384a5cbd76c14e0bb5b82 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 14:27:03 -0700 Subject: [PATCH 0035/1168] [release/v7.4.0-preview.6] Update the experimental feature JSON files (#20335) (#20363) --- experimental-feature-linux.json | 7 +------ experimental-feature-windows.json | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/experimental-feature-linux.json b/experimental-feature-linux.json index 4e413efbfc9..5adfecd7075 100644 --- a/experimental-feature-linux.json +++ b/experimental-feature-linux.json @@ -1,13 +1,8 @@ [ "PSCommandNotFoundSuggestion", "PSCommandWithArgs", - "PSConstrainedAuditLogging", - "PSCustomTableHeaderLabelDecoration", "PSFeedbackProvider", "PSLoadAssemblyFromNativeCode", "PSModuleAutoLoadSkipOfflineFiles", - "PSNativeCommandErrorActionPreference", - "PSNativeCommandPreserveBytePipe", - "PSSubsystemPluginModel", - "PSWindowsNativeCommandArgPassing" + "PSSubsystemPluginModel" ] diff --git a/experimental-feature-windows.json b/experimental-feature-windows.json index 4e413efbfc9..5adfecd7075 100644 --- a/experimental-feature-windows.json +++ b/experimental-feature-windows.json @@ -1,13 +1,8 @@ [ "PSCommandNotFoundSuggestion", "PSCommandWithArgs", - "PSConstrainedAuditLogging", - "PSCustomTableHeaderLabelDecoration", "PSFeedbackProvider", "PSLoadAssemblyFromNativeCode", "PSModuleAutoLoadSkipOfflineFiles", - "PSNativeCommandErrorActionPreference", - "PSNativeCommandPreserveBytePipe", - "PSSubsystemPluginModel", - "PSWindowsNativeCommandArgPassing" + "PSSubsystemPluginModel" ] From ea80a15890fb5e3f535af49d6c439c0a07f4ecee Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 14:28:03 -0700 Subject: [PATCH 0036/1168] [release/v7.4.0-preview.6] Fix the release build by moving to the official .NET 8-rc.1 release build version (#20333) (#20365) --- build.psm1 | 12 ++++++------ global.json | 2 +- ...rosoft.PowerShell.Commands.Diagnostics.csproj | 2 +- ...crosoft.PowerShell.Commands.Management.csproj | 2 +- .../Microsoft.PowerShell.Commands.Utility.csproj | 4 ++-- .../Microsoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 8 ++++---- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 16 ++++++++-------- .../powershell-win-core.csproj | 2 +- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 ++-- tools/findMissingNotices.ps1 | 4 ++-- tools/packaging/packaging.psm1 | 10 +++++----- .../GenericLinuxFiles/PowerShellPackage.ps1 | 2 +- 15 files changed, 37 insertions(+), 37 deletions(-) diff --git a/build.psm1 b/build.psm1 index 235d9aed3ea..27b0e493e4c 100644 --- a/build.psm1 +++ b/build.psm1 @@ -273,7 +273,7 @@ function Test-IsReleaseCandidate return $false } -$optimizedFddRegex = 'fxdependent-(linux|alpine|win|win7|osx)-(x64|x86|arm64|arm)' +$optimizedFddRegex = 'fxdependent-(linux|linux-musl|win|win7|osx)-(x64|x86|arm64|arm)' function Start-PSBuild { [CmdletBinding(DefaultParameterSetName="Default")] @@ -307,9 +307,9 @@ function Start-PSBuild { # These runtimes must match those in project.json # We do not use ValidateScript since we want tab completion # If this parameter is not provided it will get determined automatically. - [ValidateSet("alpine-x64", + [ValidateSet("linux-musl-x64", "fxdependent", - "fxdependent-alpine-x64", + "fxdependent-linux-musl-x64", "fxdependent-linux-x64", "fxdependent-linux-arm64", "fxdependent-win-desktop", @@ -898,9 +898,9 @@ function New-PSOptions { # These are duplicated from Start-PSBuild # We do not use ValidateScript since we want tab completion [ValidateSet("", - "alpine-x64", + "linux-musl-x64", "fxdependent", - "fxdependent-alpine-x64", + "fxdependent-linux-musl-x64", "fxdependent-linux-x64", "fxdependent-linux-arm64", "fxdependent-win-desktop", @@ -1346,7 +1346,7 @@ function Start-PSPester { # if we are building for Alpine, we must include the runtime as linux-x64 # will not build runnable test tools if ( $environment.IsLinux -and $environment.IsAlpine ) { - $publishArgs['runtime'] = 'alpine-x64' + $publishArgs['runtime'] = 'linux-musl-x64' } Publish-PSTestTools @publishArgs | ForEach-Object {Write-Host $_} diff --git a/global.json b/global.json index 1c036716cc1..adc56119682 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.100-rc.1.23455.8" + "version": "8.0.100-rc.1.23463.5" } } diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj index d85cf9797dc..e3fc9bd3cf3 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj @@ -8,7 +8,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 a76c7cd3dc9..4952214240a 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 9e71d3ebd6c..ce30e68eab6 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -33,8 +33,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 2e0f4153b04..5922c52e366 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 16b011fc4ee..3082c48bc23 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -19,9 +19,9 @@ - - - + + + - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index bacaa026f30..4ab85c79597 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index b33f4a8c045..0a11150a782 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -34,16 +34,16 @@ - - - - + + + + - + - - - + + + diff --git a/src/powershell-win-core/powershell-win-core.csproj b/src/powershell-win-core/powershell-win-core.csproj index 87a8221a689..73c55497c5b 100644 --- a/src/powershell-win-core/powershell-win-core.csproj +++ b/src/powershell-win-core/powershell-win-core.csproj @@ -8,7 +8,7 @@ true true true - win7-x86;win7-x64 + win-x86;win-x64 Microsoft.PowerShell ..\..\assets\pwsh.manifest Windows diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index d1298eed38a..561dac20d1f 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 6068ea71a65..89e69a428fa 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/tools/findMissingNotices.ps1 b/tools/findMissingNotices.ps1 index 0ea53c665b4..e267f718a33 100644 --- a/tools/findMissingNotices.ps1 +++ b/tools/findMissingNotices.ps1 @@ -159,7 +159,7 @@ function Get-CGRegistrations { param( [Parameter(Mandatory)] [ValidateSet( - "alpine-x64", + "linux-musl-x64", "linux-arm", "linux-arm64", "linux-x64", @@ -265,7 +265,7 @@ function Get-CGRegistrations { $registrations = [System.Collections.Generic.Dictionary[string, Registration]]::new() $lastCount = 0 $registrationChanged = $false -foreach ($runtime in "win7-x64", "linux-x64", "osx-x64", "alpine-x64", "win-arm", "linux-arm", "linux-arm64", "osx-arm64", "win-arm64", "win7-x86") { +foreach ($runtime in "win7-x64", "linux-x64", "osx-x64", "linux-musl-x64", "win-arm", "linux-arm", "linux-arm64", "osx-arm64", "win-arm64", "win7-x86") { $registrationChanged = (Get-CGRegistrations -Runtime $runtime -RegistrationTable $registrations) -or $registrationChanged $count = $registrations.Count $newCount = $count - $lastCount diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index e860390a38f..30148f0d503 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -100,7 +100,7 @@ function Start-PSPackage { } elseif ($MacOSRuntime) { $MacOSRuntime, "Release" } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-alpine") { - New-PSOptions -Configuration "Release" -Runtime "alpine-x64" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } + New-PSOptions -Configuration "Release" -Runtime "linux-musl-x64" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-arm") { New-PSOptions -Configuration "Release" -Runtime "Linux-ARM" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-arm64") { @@ -115,7 +115,7 @@ function Start-PSPackage { New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-arm64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-alpine-fxdependent") { - New-PSOptions -Configuration "Release" -Runtime 'fxdependent-alpine-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } + New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-musl-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } else { New-PSOptions -Configuration "Release" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } @@ -594,7 +594,7 @@ function Start-PSPackage { Name = $Name Version = $Version Force = $Force - Architecture = "alpine-x64" + Architecture = "linux-musl-x64" ExcludeSymbolicLinks = $true R2RVerification = [R2RVerification]@{ R2RState = 'R2R' @@ -4513,7 +4513,7 @@ function Invoke-AzDevOpsLinuxPackageBuild { $buildParams.Add("Runtime", "fxdependent") } 'alpine' { - $buildParams.Add("Runtime", 'alpine-x64') + $buildParams.Add("Runtime", 'linux-musl-x64') } } @@ -4606,7 +4606,7 @@ function Invoke-AzDevOpsLinuxPackageBuild { Remove-Item -Path $binDir -Recurse -Force } - $buildParams['Runtime'] = 'fxdependent-alpine-x64' + $buildParams['Runtime'] = 'fxdependent-linux-musl-x64' $buildFolder = "${env:SYSTEM_ARTIFACTSDIRECTORY}/${amd64AlpineFxdBuildFolder}" Start-PSBuild -Clean @buildParams @releaseTagParam -Output $buildFolder -PSOptionsPath "${buildFolder}-meta/psoptions.json" # Remove symbol files, xml document files. diff --git a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 index f96263ea6e8..ae04aed5ea3 100644 --- a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 @@ -59,7 +59,7 @@ function BuildPackages { $buildParams.Add("Runtime", "fxdependent") } elseif ($Alpine.IsPresent) { $projectAssetsZipName = 'linuxAlpineProjectAssetssymbols.zip' - $buildParams.Add("Runtime", 'alpine-x64') + $buildParams.Add("Runtime", 'linux-musl-x64') } else { # make the artifact name unique $projectAssetsZipName = "linuxProjectAssets-$((Get-Date).Ticks)-symbols.zip" From bb951753c385d47f82323ac528cfb4808ff800a7 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 15:32:58 -0700 Subject: [PATCH 0037/1168] [release/v7.4.0-preview.6] Bump `Microsoft.CodeAnalysis.CSharp` from 4.7.0 to 4.8.0-2.final (#20321) (#20368) --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- .../PSVersionInfoGenerator/PSVersionInfoGenerator.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 ce30e68eab6..6b1e87ae441 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,7 +32,7 @@ - + diff --git a/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj b/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj index d46e259fb52..4cc9ed73321 100644 --- a/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj +++ b/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj @@ -13,7 +13,7 @@ - + From 13dd6acb4d81ccbfb4b2e03f29b89f74cc1fb1be Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Mon, 25 Sep 2023 17:12:08 -0700 Subject: [PATCH 0038/1168] Updates RIDs used to generate component Inventory (#20370) --- tools/cgmanifest.json | 16 ++++++++-------- tools/findMissingNotices.ps1 | 9 ++++----- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index 8e3dfd9caaa..741ae0cbf52 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -35,7 +35,7 @@ "Type": "nuget", "Nuget": { "Name": "Json.More.Net", - "Version": "1.8.0" + "Version": "1.9.0" } }, "DevelopmentDependency": false @@ -45,7 +45,7 @@ "Type": "nuget", "Nuget": { "Name": "JsonPointer.Net", - "Version": "3.0.1" + "Version": "3.0.3" } }, "DevelopmentDependency": false @@ -55,7 +55,7 @@ "Type": "nuget", "Nuget": { "Name": "JsonSchema.Net", - "Version": "4.1.8" + "Version": "5.2.5" } }, "DevelopmentDependency": false @@ -65,7 +65,7 @@ "Type": "nuget", "Nuget": { "Name": "Markdig.Signed", - "Version": "0.32.0" + "Version": "0.33.0" } }, "DevelopmentDependency": false @@ -105,7 +105,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.CodeAnalysis.Common", - "Version": "4.6.0" + "Version": "4.7.0" } }, "DevelopmentDependency": false @@ -115,7 +115,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.CodeAnalysis.CSharp", - "Version": "4.6.0" + "Version": "4.7.0" } }, "DevelopmentDependency": false @@ -225,7 +225,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.Windows.Compatibility", - "Version": "7.0.4" + "Version": "7.0.5" } }, "DevelopmentDependency": false @@ -475,7 +475,7 @@ "Type": "nuget", "Nuget": { "Name": "System.DirectoryServices.AccountManagement", - "Version": "7.0.0" + "Version": "7.0.1" } }, "DevelopmentDependency": false diff --git a/tools/findMissingNotices.ps1 b/tools/findMissingNotices.ps1 index e267f718a33..6e372c0ede9 100644 --- a/tools/findMissingNotices.ps1 +++ b/tools/findMissingNotices.ps1 @@ -165,10 +165,9 @@ function Get-CGRegistrations { "linux-x64", "osx-arm64", "osx-x64", - "win-arm", "win-arm64", - "win7-x64", - "win7-x86", + "win-x64", + "win-x86", "modules")] [string]$Runtime, @@ -197,7 +196,7 @@ function Get-CGRegistrations { $folder = $unixProjectName $target = "$dotnetTargetName|$Runtime" } - "win7-.*" { + "win-x*" { $sdkToUse = $winDesktopSdk $folder = $windowsProjectName $target = "$dotnetTargetNameWin7|$Runtime" @@ -265,7 +264,7 @@ function Get-CGRegistrations { $registrations = [System.Collections.Generic.Dictionary[string, Registration]]::new() $lastCount = 0 $registrationChanged = $false -foreach ($runtime in "win7-x64", "linux-x64", "osx-x64", "linux-musl-x64", "win-arm", "linux-arm", "linux-arm64", "osx-arm64", "win-arm64", "win7-x86") { +foreach ($runtime in "win-x64", "linux-x64", "osx-x64", "linux-musl-x64", "linux-arm", "linux-arm64", "osx-arm64", "win-arm64", "win-x86") { $registrationChanged = (Get-CGRegistrations -Runtime $runtime -RegistrationTable $registrations) -or $registrationChanged $count = $registrations.Count $newCount = $count - $lastCount From b5b6204f10a08e3b6d49d36ff897573ef3888f88 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 25 Sep 2023 17:17:28 -0700 Subject: [PATCH 0039/1168] [release/v7.4.0-preview.6] Updates RIDs used to generate component Inventory (#20370) (#20372) Co-authored-by: Travis Plunk --- tools/cgmanifest.json | 16 ++++++++-------- tools/findMissingNotices.ps1 | 9 ++++----- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index f52550c61ce..741ae0cbf52 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -35,7 +35,7 @@ "Type": "nuget", "Nuget": { "Name": "Json.More.Net", - "Version": "1.8.0" + "Version": "1.9.0" } }, "DevelopmentDependency": false @@ -45,7 +45,7 @@ "Type": "nuget", "Nuget": { "Name": "JsonPointer.Net", - "Version": "3.0.1" + "Version": "3.0.3" } }, "DevelopmentDependency": false @@ -55,7 +55,7 @@ "Type": "nuget", "Nuget": { "Name": "JsonSchema.Net", - "Version": "4.1.8" + "Version": "5.2.5" } }, "DevelopmentDependency": false @@ -65,7 +65,7 @@ "Type": "nuget", "Nuget": { "Name": "Markdig.Signed", - "Version": "0.31.0" + "Version": "0.33.0" } }, "DevelopmentDependency": false @@ -105,7 +105,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.CodeAnalysis.Common", - "Version": "4.6.0" + "Version": "4.7.0" } }, "DevelopmentDependency": false @@ -115,7 +115,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.CodeAnalysis.CSharp", - "Version": "4.6.0" + "Version": "4.7.0" } }, "DevelopmentDependency": false @@ -225,7 +225,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.Windows.Compatibility", - "Version": "7.0.4" + "Version": "7.0.5" } }, "DevelopmentDependency": false @@ -475,7 +475,7 @@ "Type": "nuget", "Nuget": { "Name": "System.DirectoryServices.AccountManagement", - "Version": "7.0.0" + "Version": "7.0.1" } }, "DevelopmentDependency": false diff --git a/tools/findMissingNotices.ps1 b/tools/findMissingNotices.ps1 index e267f718a33..6e372c0ede9 100644 --- a/tools/findMissingNotices.ps1 +++ b/tools/findMissingNotices.ps1 @@ -165,10 +165,9 @@ function Get-CGRegistrations { "linux-x64", "osx-arm64", "osx-x64", - "win-arm", "win-arm64", - "win7-x64", - "win7-x86", + "win-x64", + "win-x86", "modules")] [string]$Runtime, @@ -197,7 +196,7 @@ function Get-CGRegistrations { $folder = $unixProjectName $target = "$dotnetTargetName|$Runtime" } - "win7-.*" { + "win-x*" { $sdkToUse = $winDesktopSdk $folder = $windowsProjectName $target = "$dotnetTargetNameWin7|$Runtime" @@ -265,7 +264,7 @@ function Get-CGRegistrations { $registrations = [System.Collections.Generic.Dictionary[string, Registration]]::new() $lastCount = 0 $registrationChanged = $false -foreach ($runtime in "win7-x64", "linux-x64", "osx-x64", "linux-musl-x64", "win-arm", "linux-arm", "linux-arm64", "osx-arm64", "win-arm64", "win7-x86") { +foreach ($runtime in "win-x64", "linux-x64", "osx-x64", "linux-musl-x64", "linux-arm", "linux-arm64", "osx-arm64", "win-arm64", "win-x86") { $registrationChanged = (Get-CGRegistrations -Runtime $runtime -RegistrationTable $registrations) -or $registrationChanged $count = $registrations.Count $newCount = $count - $lastCount From 78cbbc3a02aa3fb5723e8f8381db3d95adc08779 Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Tue, 26 Sep 2023 12:27:28 +0900 Subject: [PATCH 0040/1168] Fix typo in FileCatalog.Tests.ps1 (#20329) existant -> existent --- .../Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 index 2a99c225d22..17fb384cf58 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 @@ -45,7 +45,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { It "NewFileCatalogWithSingleFile with WhatIf" { $sourcePath = Join-Path $testDataPath '\CatalogTestFile1.mof' - # use existant Path for the directory when .cat file name is not specified + # use existent Path for the directory when .cat file name is not specified $catalogPath = $testDataPath $catalogFile = $catalogPath + "\catalog.cat" @@ -87,7 +87,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { It "NewFileCatalogFolderWithSubFolders" { $sourcePath = Join-Path $testDataPath 'UserConfigProv' - # use non existant Path for the directory when .cat file name is specified + # use non existent Path for the directory when .cat file name is specified $catalogPath = "$testDataPath\OutPutCatalog\NewFileCatalogFolderWithSubFolders.cat" try @@ -109,7 +109,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { It "NewFileCatalogWithSingleFile" { $sourcePath = Join-Path $testDataPath '\CatalogTestFile1.mof' - # use existant Path for the directory when .cat file name is not specified + # use existent Path for the directory when .cat file name is not specified $catalogPath = $testDataPath try { @@ -130,7 +130,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { $expectedPathsAndHashes = @{ "TestImage.gif" = "B0E4B9F0BB21284AA0AF0D525C913420AD73DA6A" ; "TestFileCatalog.txt" = "BA6A26C5F19AB50B0D5BE2A9D445B259998B0DD9" } - # use non existant Path for the directory when .cat file name is not specified + # use non existent Path for the directory when .cat file name is not specified $catalogPath = "$testDataPath\OutPutCatalog" try From be4494938ad3216feda4b674d1ab7fb4da3106fe Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 25 Sep 2023 22:02:53 -0700 Subject: [PATCH 0041/1168] Remove the `ref` folder before running compliance (#20373) --- .../azureDevOps/templates/compliance/apiscan.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml index e15a42ff63c..730e86fd516 100644 --- a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml +++ b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml @@ -59,6 +59,11 @@ jobs: $OutputFolder = Split-Path (Get-PSOutput) Write-Host "##vso[task.setvariable variable=BinDir]$OutputFolder" + + Write-Verbose -Verbose -Message "Deleting ref folder from output folder" + if (Test-Path $OutputFolder/ref) { + Remove-Item -Recurse -Force $OutputFolder/ref + } workingDirectory: '$(Build.SourcesDirectory)' displayName: 'Build PowerShell Source' From 86ae2996fb6ae871c3ec0974ac8afd5ff2c6fbee Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 26 Sep 2023 09:23:43 -0700 Subject: [PATCH 0042/1168] [release/v7.4.0-preview.6] Remove the `ref` folder before running compliance (#20373) (#20375) --- .../azureDevOps/templates/compliance/apiscan.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml index e15a42ff63c..730e86fd516 100644 --- a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml +++ b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml @@ -59,6 +59,11 @@ jobs: $OutputFolder = Split-Path (Get-PSOutput) Write-Host "##vso[task.setvariable variable=BinDir]$OutputFolder" + + Write-Verbose -Verbose -Message "Deleting ref folder from output folder" + if (Test-Path $OutputFolder/ref) { + Remove-Item -Recurse -Force $OutputFolder/ref + } workingDirectory: '$(Build.SourcesDirectory)' displayName: 'Build PowerShell Source' From 667e8cc29f8829e2ca688e26c122d0582b50cf41 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 26 Sep 2023 17:15:07 +0000 Subject: [PATCH 0043/1168] Merged PR 27772: Update ThirdPartyNotices.txt Update ThirdPartyNotices.txt --- ThirdPartyNotices.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 9b173d44633..cfda2226963 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -135,7 +135,7 @@ limitations under the License. --------------------------------------------------------- -Markdig.Signed 0.31.0 - BSD-2-Clause +Markdig.Signed 0.33.0 - BSD-2-Clause @@ -172,7 +172,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Json.More.Net 1.8.0 - MIT +Json.More.Net 1.9.0 - MIT (c) Microsoft 2023 @@ -205,7 +205,7 @@ SOFTWARE. --------------------------------------------------------- -JsonPointer.Net 3.0.1 - MIT +JsonPointer.Net 3.0.3 - MIT (c) Microsoft 2023 @@ -238,7 +238,7 @@ SOFTWARE. --------------------------------------------------------- -JsonSchema.Net 4.1.8 - MIT +JsonSchema.Net 5.2.5 - MIT @@ -343,7 +343,7 @@ SOFTWARE. --------------------------------------------------------- -Microsoft.CodeAnalysis.Common 4.6.0 - MIT +Microsoft.CodeAnalysis.Common 4.7.0 - MIT (c) Microsoft Corporation @@ -363,7 +363,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.CodeAnalysis.CSharp 4.6.0 - MIT +Microsoft.CodeAnalysis.CSharp 4.7.0 - MIT (c) Microsoft Corporation @@ -696,7 +696,7 @@ SOFTWARE. --------------------------------------------------------- -Microsoft.Windows.Compatibility 7.0.4 - MIT +Microsoft.Windows.Compatibility 7.0.5 - MIT (c) Microsoft Corporation @@ -2294,7 +2294,7 @@ SOFTWARE. --------------------------------------------------------- -System.DirectoryServices.AccountManagement 7.0.0 - MIT +System.DirectoryServices.AccountManagement 7.0.1 - MIT (c) Microsoft Corporation From 9ebeca3d6e1a133cf052dd01aab3d8fd1b724dcf Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 26 Sep 2023 16:07:00 -0700 Subject: [PATCH 0044/1168] Fix implicit remoting proxy cmdlets to act on common parameters (#20367) --- .../commands/utility/ImplicitRemotingCommands.cs | 14 ++++++++++++-- .../CompatiblePSEditions.Module.Tests.ps1 | 11 +++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs index 6dbbc04fea1..3b7db715953 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs @@ -1300,13 +1300,23 @@ private ParameterMetadata RehydrateParameterMetadata(PSObject deserializedParame parameterType); } - private static bool IsProxyForCmdlet(Dictionary parameters) + private bool IsProxyForCmdlet(Dictionary parameters) { // we are not sending CmdletBinding/DefaultParameterSet over the wire anymore // we need to infer IsProxyForCmdlet from presence of all common parameters - foreach (string commonParameterName in Cmdlet.CommonParameters) + // need to exclude `ProgressAction` which may not exist for downlevel platforms + bool isDownLevelRemote = Session.Runspace is RemoteRunspace remoteRunspace + && remoteRunspace.ServerVersion is not null + && remoteRunspace.ServerVersion <= new Version(7, 3); + + foreach (string commonParameterName in CommonParameters) { + if (isDownLevelRemote && commonParameterName == "ProgressAction") + { + continue; + } + if (!parameters.ContainsKey(commonParameterName)) { return false; 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 a9c9b69b202..d4423b034b9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 @@ -1532,4 +1532,15 @@ Describe "WinCompat importing should check availablity of built-in modules" -Tag $result[4] | Should -BeExactly 'ConvertFrom-String' $result[5] | Should -BeExactly 'CFS' } + + It 'ErrorAction should be used for cmdlet' { + try { + $out = Invoke-Expression 'get-AppLockerFileInformation NoSuch.exe -ErrorAction Stop; "after"' + } + catch { + # do nothing as we expect an error, but execution should not continue + } + + $out | Should -Not -Contain 'after' + } } From 86e2757c1b54cc9df5a164127854383aaf319cf6 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 27 Sep 2023 17:03:18 +0000 Subject: [PATCH 0045/1168] Merged PR 27783: Update the regex for package name validation Update the regex for package name validation --- .../azureDevOps/templates/release-ValidatePackageNames.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml index 50d75753f1f..da3d265a406 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml @@ -44,7 +44,7 @@ steps: - pwsh: | $message = @() Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -filter *.tar.gz | ForEach-Object { - if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-alpine)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-alpine\-fxdependent)\.(tar\.gz)') + if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-linux-musl)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-fxdependent)\.(tar\.gz)') { $messageInstance = "$($_.Name) is not a valid package name" $message += $messageInstance From 38d87fe7c2173847ce45a87ff43f69c056169b23 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 27 Sep 2023 19:39:04 +0000 Subject: [PATCH 0046/1168] Merged PR 27795: Fix the regex for package name validation Fix the regex for package name validation --- .../azureDevOps/templates/release-ValidatePackageNames.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml index da3d265a406..a00ac4a8573 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml @@ -44,7 +44,7 @@ steps: - pwsh: | $message = @() Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -filter *.tar.gz | ForEach-Object { - if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-linux-musl)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-fxdependent)\.(tar\.gz)') + if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-linux-musl)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-alpine\-fxdependent)\.(tar\.gz)') { $messageInstance = "$($_.Name) is not a valid package name" $message += $messageInstance From 11ae15b093b5c5db92be173b28eac696bc6d8da8 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 27 Sep 2023 23:14:11 +0000 Subject: [PATCH 0047/1168] Merged PR 27790: Update changelog for v7.4.0-preview.6 release Update changelog for v7.4.0-preview.6 release. Ran `textlint --rule terminology .\CHANGELOG\preview.md` locally and test passed. --- CHANGELOG/preview.md | 59 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/CHANGELOG/preview.md b/CHANGELOG/preview.md index ea1e0efc497..11027a45126 100644 --- a/CHANGELOG/preview.md +++ b/CHANGELOG/preview.md @@ -1,5 +1,64 @@ # Current preview release +## [7.4.0-preview.6] - 2023-09-28 + +### General Cmdlet Updates and Fixes + +- Set approved experimental features to stable for 7.4 release (#20362) +- Revert changes to continue using `BinaryFormatter` for `Out-GridView` (#20360) +- Remove the comment trigger from feedback provider (#20346) + +### Tests + +- Continued improvement to tests for release automation (#20259) +- Skip the test on x86 as `InstallDate` is not visible on `Wow64` (#20255) +- Harden some problematic release tests (#20254) + +### Build and Packaging Improvements + +
+ + + +

Move to .NET 8.0.100-rc.1.23463.5

+ +
+ +
    +
  • Update the regex for package name validation (Internal 27783, 27795)
  • +
  • Update ThirdPartyNotices.txt (Internal 27772)
  • +
  • Remove the ref folder before running compliance (#20375)
  • +
  • Updates RIDs used to generate component Inventory (#20372)
  • +
  • Bump Microsoft.CodeAnalysis.CSharp from 4.7.0 to 4.8.0-2.final (#20368)
  • +
  • Fix the release build by moving to the official .NET 8-rc.1 release build version (#20365)
  • +
  • Update the experimental feature JSON files (#20363)
  • +
  • Bump XunitXml.TestLogger from 3.1.11 to 3.1.17 (#20364)
  • +
  • Update Microsoft.PowerShell.PSResourceGet to 0.9.0-rc1 (#20361)
  • +
  • Update .NET SDK to version 8.0.100-rc.1.23455.8 (#20358)
  • +
  • Use fxdependent-win-desktop runtime for compliance runs (#20359)
  • +
  • Add mapping for mariner arm64 stable (#20348)
  • +
  • Bump xunit.runner.visualstudio from 2.5.0 to 2.5.1 (#20357)
  • +
  • Bump JsonSchema.Net from 5.2.1 to 5.2.5 (#20356)
  • +
  • Bump Microsoft.NET.Test.Sdk from 17.7.1 to 17.7.2 (#20355)
  • +
  • Bump Markdig.Signed from 0.32.0 to 0.33.0 (#20354)
  • +
  • Bump JsonSchema.Net from 5.1.3 to 5.2.1 (#20353)
  • +
  • Bump actions/checkout from 3 to 4 (#20352)
  • +
  • Bump Microsoft.NET.Test.Sdk from 17.7.0 to 17.7.1 (#20351)
  • +
  • Bump Microsoft.CodeAnalysis.CSharp from 4.7.0-2.final to 4.7.0 (#20350)
  • +
  • Release build: Change the names of the PATs (#20349)
  • +
  • Put the calls to Set-AzDoProjectInfo and Set-AzDoAuthToken` in the right order (#20347)
  • +
  • Bump Microsoft.Management.Infrastructure (continued) (#20262)
  • +
  • Bump Microsoft.Management.Infrastructure to 3.0.0-preview.2 (#20261)
  • +
  • Enable vPack provenance data (#20260)
  • +
  • Start using new packages.microsoft.com cli (#20258)
  • +
  • Add mariner arm64 to PMC release (#20257)
  • +
  • Fix typo donet to dotnet in build scripts and pipelines (#20256)
  • +
+ +
+ +[7.4.0-preview.6]: https://github.com/PowerShell/PowerShell/compare/v7.4.0-preview.5...v7.4.0-preview.6 + ## [7.4.0-preview.5] - 2023-08-21 ### Breaking Changes From c4fc2b27bb7ef5022606a07787f2ce1ef30ac605 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 28 Sep 2023 10:06:27 -0700 Subject: [PATCH 0048/1168] Update `README.md` and `metadata.json` for v7.4.0-preview.6 release (#20386) --- README.md | 28 ++++++++++++++-------------- tools/metadata.json | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 045beec97b0..7d5fa832dcb 100644 --- a/README.md +++ b/README.md @@ -93,20 +93,20 @@ You can also download the PowerShell binary archives for Windows, macOS and Linu [rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-linux-arm64.tar.gz [rl-snap]: https://snapcraft.io/powershell -[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/PowerShell-7.4.0-preview.5-win-x64.msi -[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/PowerShell-7.4.0-preview.5-win-x86.msi -[pv-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-preview_7.4.0-preview.5-1.deb_amd64.deb -[pv-rpm]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-preview-7.4.0_preview.5-1.rh.x86_64.rpm -[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-osx-x64.pkg -[pv-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-osx-arm64.pkg -[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/PowerShell-7.4.0-preview.5-win-arm64.zip -[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/PowerShell-7.4.0-preview.5-win-x86.zip -[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/PowerShell-7.4.0-preview.5-win-x64.zip -[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-osx-x64.tar.gz -[pv-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-osx-arm64.tar.gz -[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-linux-x64.tar.gz -[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-linux-arm32.tar.gz -[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-linux-arm64.tar.gz +[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/PowerShell-7.4.0-preview.6-win-x64.msi +[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/PowerShell-7.4.0-preview.6-win-x86.msi +[pv-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-preview_7.4.0-preview.6-1.deb_amd64.deb +[pv-rpm]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-preview-7.4.0_preview.6-1.rh.x86_64.rpm +[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-osx-x64.pkg +[pv-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-osx-arm64.pkg +[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/PowerShell-7.4.0-preview.6-win-arm64.zip +[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/PowerShell-7.4.0-preview.6-win-x86.zip +[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/PowerShell-7.4.0-preview.6-win-x64.zip +[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-osx-x64.tar.gz +[pv-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-osx-arm64.tar.gz +[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-linux-x64.tar.gz +[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-linux-arm32.tar.gz +[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-linux-arm64.tar.gz [pv-snap]: https://snapcraft.io/powershell-preview [in-windows]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows diff --git a/tools/metadata.json b/tools/metadata.json index 389f2b313c6..e76f7f87953 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,10 +1,10 @@ { "StableReleaseTag": "v7.3.7", - "PreviewReleaseTag": "v7.4.0-preview.5", + "PreviewReleaseTag": "v7.4.0-preview.6", "ServicingReleaseTag": "v7.0.13", "ReleaseTag": "v7.3.7", "LTSReleaseTag" : ["v7.2.14"], - "NextReleaseTag": "v7.4.0-preview.6", + "NextReleaseTag": "v7.4.0-preview.7", "LTSRelease": { "Latest": false, "Package": false }, "StableRelease": { "Latest": false, "Package": false } } From be2a86fc4cc7cf8c89c62cbec50b63266194f874 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 28 Sep 2023 10:43:58 -0700 Subject: [PATCH 0049/1168] Bring updates in the v7.4.0-preview.6 release branch to the master branch (#20389) --- CHANGELOG/preview.md | 59 +++++++++++++++++++ .../release-ValidatePackageNames.yml | 2 +- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/CHANGELOG/preview.md b/CHANGELOG/preview.md index ea1e0efc497..11027a45126 100644 --- a/CHANGELOG/preview.md +++ b/CHANGELOG/preview.md @@ -1,5 +1,64 @@ # Current preview release +## [7.4.0-preview.6] - 2023-09-28 + +### General Cmdlet Updates and Fixes + +- Set approved experimental features to stable for 7.4 release (#20362) +- Revert changes to continue using `BinaryFormatter` for `Out-GridView` (#20360) +- Remove the comment trigger from feedback provider (#20346) + +### Tests + +- Continued improvement to tests for release automation (#20259) +- Skip the test on x86 as `InstallDate` is not visible on `Wow64` (#20255) +- Harden some problematic release tests (#20254) + +### Build and Packaging Improvements + +
+ + + +

Move to .NET 8.0.100-rc.1.23463.5

+ +
+ +
    +
  • Update the regex for package name validation (Internal 27783, 27795)
  • +
  • Update ThirdPartyNotices.txt (Internal 27772)
  • +
  • Remove the ref folder before running compliance (#20375)
  • +
  • Updates RIDs used to generate component Inventory (#20372)
  • +
  • Bump Microsoft.CodeAnalysis.CSharp from 4.7.0 to 4.8.0-2.final (#20368)
  • +
  • Fix the release build by moving to the official .NET 8-rc.1 release build version (#20365)
  • +
  • Update the experimental feature JSON files (#20363)
  • +
  • Bump XunitXml.TestLogger from 3.1.11 to 3.1.17 (#20364)
  • +
  • Update Microsoft.PowerShell.PSResourceGet to 0.9.0-rc1 (#20361)
  • +
  • Update .NET SDK to version 8.0.100-rc.1.23455.8 (#20358)
  • +
  • Use fxdependent-win-desktop runtime for compliance runs (#20359)
  • +
  • Add mapping for mariner arm64 stable (#20348)
  • +
  • Bump xunit.runner.visualstudio from 2.5.0 to 2.5.1 (#20357)
  • +
  • Bump JsonSchema.Net from 5.2.1 to 5.2.5 (#20356)
  • +
  • Bump Microsoft.NET.Test.Sdk from 17.7.1 to 17.7.2 (#20355)
  • +
  • Bump Markdig.Signed from 0.32.0 to 0.33.0 (#20354)
  • +
  • Bump JsonSchema.Net from 5.1.3 to 5.2.1 (#20353)
  • +
  • Bump actions/checkout from 3 to 4 (#20352)
  • +
  • Bump Microsoft.NET.Test.Sdk from 17.7.0 to 17.7.1 (#20351)
  • +
  • Bump Microsoft.CodeAnalysis.CSharp from 4.7.0-2.final to 4.7.0 (#20350)
  • +
  • Release build: Change the names of the PATs (#20349)
  • +
  • Put the calls to Set-AzDoProjectInfo and Set-AzDoAuthToken` in the right order (#20347)
  • +
  • Bump Microsoft.Management.Infrastructure (continued) (#20262)
  • +
  • Bump Microsoft.Management.Infrastructure to 3.0.0-preview.2 (#20261)
  • +
  • Enable vPack provenance data (#20260)
  • +
  • Start using new packages.microsoft.com cli (#20258)
  • +
  • Add mariner arm64 to PMC release (#20257)
  • +
  • Fix typo donet to dotnet in build scripts and pipelines (#20256)
  • +
+ +
+ +[7.4.0-preview.6]: https://github.com/PowerShell/PowerShell/compare/v7.4.0-preview.5...v7.4.0-preview.6 + ## [7.4.0-preview.5] - 2023-08-21 ### Breaking Changes diff --git a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml index 50d75753f1f..a00ac4a8573 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml @@ -44,7 +44,7 @@ steps: - pwsh: | $message = @() Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -filter *.tar.gz | ForEach-Object { - if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-alpine)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-alpine\-fxdependent)\.(tar\.gz)') + if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-linux-musl)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-alpine\-fxdependent)\.(tar\.gz)') { $messageInstance = "$($_.Name) is not a valid package name" $message += $messageInstance From dab6ca28f545d2c15dc4cc9e5121daf3b24b47bd Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Thu, 28 Sep 2023 11:04:40 -0700 Subject: [PATCH 0050/1168] Update to the latest NOTICES file (#20385) --- ThirdPartyNotices.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index e17b949a6d8..cfda2226963 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -135,7 +135,7 @@ limitations under the License. --------------------------------------------------------- -Markdig.Signed 0.32.0 - BSD-2-Clause +Markdig.Signed 0.33.0 - BSD-2-Clause @@ -172,7 +172,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Json.More.Net 1.8.0 - MIT +Json.More.Net 1.9.0 - MIT (c) Microsoft 2023 @@ -205,7 +205,7 @@ SOFTWARE. --------------------------------------------------------- -JsonPointer.Net 3.0.1 - MIT +JsonPointer.Net 3.0.3 - MIT (c) Microsoft 2023 @@ -238,7 +238,7 @@ SOFTWARE. --------------------------------------------------------- -JsonSchema.Net 4.1.8 - MIT +JsonSchema.Net 5.2.5 - MIT @@ -343,7 +343,7 @@ SOFTWARE. --------------------------------------------------------- -Microsoft.CodeAnalysis.Common 4.6.0 - MIT +Microsoft.CodeAnalysis.Common 4.7.0 - MIT (c) Microsoft Corporation @@ -363,7 +363,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.CodeAnalysis.CSharp 4.6.0 - MIT +Microsoft.CodeAnalysis.CSharp 4.7.0 - MIT (c) Microsoft Corporation @@ -696,7 +696,7 @@ SOFTWARE. --------------------------------------------------------- -Microsoft.Windows.Compatibility 7.0.4 - MIT +Microsoft.Windows.Compatibility 7.0.5 - MIT (c) Microsoft Corporation @@ -2294,7 +2294,7 @@ SOFTWARE. --------------------------------------------------------- -System.DirectoryServices.AccountManagement 7.0.0 - MIT +System.DirectoryServices.AccountManagement 7.0.1 - MIT (c) Microsoft Corporation From 0beb4dad4407c689afca3e75c84ff59074f6d69c Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Fri, 29 Sep 2023 14:22:14 -0700 Subject: [PATCH 0051/1168] Revert "Update AppxManifest.xml to show application name on DefaultTile for Windows 10 21H2/22H2 Start Menu (#20080)" (#20396) This change is causing our build to fail when producing MSIX package for Windows x64, x86 and arm64. --- assets/AppxManifest.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/assets/AppxManifest.xml b/assets/AppxManifest.xml index ec0caa6a37c..c646bcdf94b 100644 --- a/assets/AppxManifest.xml +++ b/assets/AppxManifest.xml @@ -37,11 +37,6 @@ - - - - - From 63178bb66db8abebad15abf3b8de3e207c711be5 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 2 Oct 2023 14:58:56 -0700 Subject: [PATCH 0052/1168] Fix `Test-Connection` due to .NET 8 changes (#20369) --- .../commands/management/TestConnectionCommand.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs index 1f497e5dd2c..1370a56ea96 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs @@ -56,7 +56,7 @@ public class TestConnectionCommand : PSCmdlet, IDisposable #region Private Fields - private static byte[]? s_DefaultSendBuffer; + private static readonly byte[] s_DefaultSendBuffer = Array.Empty(); private readonly CancellationTokenSource _dnsLookupCancel = new(); @@ -484,7 +484,10 @@ private void ProcessTraceroute(string targetNameOrAddress) reply.Status == IPStatus.Success ? reply.RoundtripTime : timer.ElapsedMilliseconds, - buffer.Length, + + // If we use the empty buffer, then .NET actually uses a 32 byte buffer so we want to show + // as the result object the actual buffer size used instead of 0. + buffer.Length == 0 ? DefaultSendBufferSize : buffer.Length, pingNum: i); WriteObject(new TraceStatus( currentHop, @@ -707,7 +710,7 @@ private void ProcessPing(string targetNameOrAddress) resolvedTargetName, reply, reply.RoundtripTime, - buffer.Length, + buffer.Length == 0 ? DefaultSendBufferSize : buffer.Length, pingNum: (uint)i)); } @@ -862,7 +865,7 @@ private IPHostEntry GetCancellableHostEntry(string targetNameOrAddress) // Creates and fills a send buffer. This follows the ping.exe and CoreFX model. private static byte[] GetSendBuffer(int bufferSize) { - if (bufferSize == DefaultSendBufferSize && s_DefaultSendBuffer != null) + if (bufferSize == DefaultSendBufferSize) { return s_DefaultSendBuffer; } @@ -874,11 +877,6 @@ private static byte[] GetSendBuffer(int bufferSize) sendBuffer[i] = (byte)((int)'a' + i % 23); } - if (bufferSize == DefaultSendBufferSize && s_DefaultSendBuffer == null) - { - s_DefaultSendBuffer = sendBuffer; - } - return sendBuffer; } From 53a2edac5342215d231f26c8e0fd76f495bd1d20 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 2 Oct 2023 16:11:26 -0700 Subject: [PATCH 0053/1168] Add surrogate file for compliance scanning (#20423) --- .../templates/compliance/apiscan.yml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml index 730e86fd516..ea5efe0b224 100644 --- a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml +++ b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml @@ -17,6 +17,8 @@ jobs: - name: branchCounter value: $[counter(variables['branchCounterKey'], 1)] - group: DotNetPrivateBuildAccess + - group: Azure Blob variable group + - group: ReleasePipelineSecrets pool: name: PowerShell1ES @@ -52,6 +54,29 @@ jobs: displayName: Install dotnet-symbol retryCountOnTaskFailure: 2 + - pwsh: | + Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1' + Install-AzCopy + displayName: Install AzCopy + retryCountOnTaskFailure: 2 + + - pwsh: | + Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1' + $azcopy = Find-AzCopy + Write-Verbose -Verbose "Found AzCopy: $azcopy" + + $winverifySymbolsPath = New-Item -ItemType Directory -Path '$(System.ArtifactsDirectory)/winverify-symbols' -Force + Write-Host "##vso[task.setvariable variable=winverifySymbolsPath]$winverifySymbolsPath" + + & $azcopy cp https://$(StorageAccount).blob.core.windows.net/winverify-private $winverifySymbolsPath --recursive + + Get-ChildItem $winverifySymbolsPath -Recurse | Out-String | Write-Verbose -Verbose + + displayName: Download winverify-private Artifacts + retryCountOnTaskFailure: 2 + env: + AZCOPY_AUTO_LOGIN_TYPE: MSI + - pwsh: | Import-Module .\build.psm1 -force Find-DotNet @@ -64,6 +89,39 @@ jobs: if (Test-Path $OutputFolder/ref) { Remove-Item -Recurse -Force $OutputFolder/ref } + + $surrogateFileTemplate = @' + + + + + + + + {path_to_symbol} + + + + + + + + + + + '@ + + $pathToDll = Get-ChildItem -Path $OutputFolder -Filter 'getfilesiginforedist.dll' -Recurse | Where-Object { $_.fullname -like '*win-x64*' } | Select-Object -First 1 -ExpandProperty FullName + + $surrogateFile = Join-Path $(Pipeline.Workspace) 'APIScanSurrogates.xml' + $surrogateFileContent = $surrogateFileTemplate -replace '{path_to_symbol}', '$(winverifySymbolsPath)\winverify-private' -replace '{path_to_dll}', '$(winverifySymbolsPath)\winverify-private\getfilesiginforedist.dll' -replace '{path_to_dll_in_build}', $pathToDll + $surrogateFileContent | Out-File -FilePath $surrogateFile -Force + + Write-Verbose -Verbose -Message "Surrogate file content:" + Get-Content -Path $surrogateFile -Raw | Out-String | Write-Verbose -Verbose + + Write-Host "##vso[task.setvariable variable=surrogateFilePath]$(Pipeline.Workspace)" + workingDirectory: '$(Build.SourcesDirectory)' displayName: 'Build PowerShell Source' @@ -117,6 +175,7 @@ jobs: verbosityLevel: standard # write a status update every 5 minutes. Default is 1 minute statusUpdateInterval: '00:05:00' + surrogateConfigurationFolder : $(surrogateFilePath) env: AzureServicesAuthConnectionString: RunAs=App;AppId=$(APIScanClient);TenantId=$(APIScanTenant);AppKey=$(APIScanSecret) From 8f09e3c2d8329411a50a61b077b343236f3f99b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 07:16:28 -0700 Subject: [PATCH 0054/1168] Bump JsonSchema.Net from 5.2.5 to 5.2.6 (#20421) --- .../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 6b1e87ae441..f7410061a63 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -35,7 +35,7 @@ - +
From 109c2425aced495d3ce31fb75242c3a19fb3f748 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 3 Oct 2023 11:28:44 -0700 Subject: [PATCH 0055/1168] Bump PSReadLine from 2.2.6 to 2.3.4 (#20305) --- src/Modules/PSGalleryModules.csproj | 2 +- test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 | 4 ++-- tools/packaging/boms/windows.json | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Modules/PSGalleryModules.csproj b/src/Modules/PSGalleryModules.csproj index a96bac9f64d..bcf0db7e092 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -15,7 +15,7 @@ - + diff --git a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 index 6e5924d9c55..975f4f82da3 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 -Match '^2.2.\d$' + $module.Version | Should -Match '^2.3.\d$' } 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 -Match '^2.2.\d$' + $module.Version | Should -Match '^2.3.\d$' $module.Path | Should -Be (Join-Path -Path $PSHOME -ChildPath "Modules/PSReadLine/PSReadLine.psd1") } diff --git a/tools/packaging/boms/windows.json b/tools/packaging/boms/windows.json index f1a9bec1ed5..4ec63b872c2 100644 --- a/tools/packaging/boms/windows.json +++ b/tools/packaging/boms/windows.json @@ -827,6 +827,10 @@ "Pattern": "Modules/Microsoft.PowerShell.PSResourceGet/Microsoft.PowerShell.PSResourceGet.psd1", "FileType": "NonProduct" }, + { + "Pattern": "Modules/Microsoft.PowerShell.PSResourceGet/Microsoft.PowerShell.PSResourceGet.psm1", + "FileType": "NonProduct" + }, { "Pattern": "Modules/Microsoft.PowerShell.PSResourceGet/Notice.txt", "FileType": "NonProduct" @@ -900,7 +904,7 @@ "FileType": "NonProduct" }, { - "Pattern": "Modules/Microsoft.PowerShell.PSResourceGet/Microsoft.PowerShell.PSResourceGet.psm1", + "Pattern": "Modules\\PSReadLine\\_manifest\\spdx_2.2\\manifest.cat", "FileType": "NonProduct" }, { From d8fd78ca6a801485bde82eb11ec37abe9e404d5e Mon Sep 17 00:00:00 2001 From: Steven Bucher Date: Thu, 5 Oct 2023 09:18:14 -0700 Subject: [PATCH 0056/1168] Adding survey comment for closed issues (#20397) --- .github/policies/resourceManagement.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml index 2f1f1202691..edad3b2e486 100644 --- a/.github/policies/resourceManagement.yml +++ b/.github/policies/resourceManagement.yml @@ -368,6 +368,13 @@ configuration: then: - removeLabel: label: Waiting on Author - description: + description: Automatically commenting for feedback when an issue is closed + triggerOnOwnActions: true + - if: + - isAction: + action: Closed + then: + - addReply: + reply: " 📣 Hey @${issueAuthor}, how did we do? We would love to hear your feedback with the link below! 🗣️ \n\n🔗 https://forms.office.com/r/P926k48jRJ " onFailure: onSuccess: From ebeda8ca7c29fcc39eac9ae5bf6f32b94cb79025 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 09:20:12 -0700 Subject: [PATCH 0057/1168] Bump Microsoft.Management.Infrastructure (#20433) --- .../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 0a11150a782..2d45cea0f7a 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -45,7 +45,7 @@ - + From 21af781f3f71290a748f4cf8738055003d26a25b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 09:20:45 -0700 Subject: [PATCH 0058/1168] Bump Microsoft.Management.Infrastructure (#20434) --- .../System.Management.Automation.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ea8692d1411..135b0fcba39 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 @@ -8,7 +8,7 @@ 11.0 - + From 3791f17d9c33df7de73cd82c6891e3766c7a566e Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Thu, 5 Oct 2023 09:21:17 -0700 Subject: [PATCH 0059/1168] Update the cgmanifest (#20436) --- tools/cgmanifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index 741ae0cbf52..0b2f8d4c279 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -55,7 +55,7 @@ "Type": "nuget", "Nuget": { "Name": "JsonSchema.Net", - "Version": "5.2.5" + "Version": "5.2.6" } }, "DevelopmentDependency": false From a24e954069739ce8ae789870589ac8a8420df5d9 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 9 Oct 2023 14:54:38 -0700 Subject: [PATCH 0060/1168] Fix alpine tar package name and do not crossgen alpine fxdependent package (#20459) --- build.psm1 | 8 ++++---- tools/packaging/packaging.psm1 | 10 +++++----- .../Images/GenericLinuxFiles/PowerShellPackage.ps1 | 2 +- tools/releaseBuild/azureDevOps/templates/nuget.yml | 2 +- .../templates/release-ValidatePackageNames.yml | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build.psm1 b/build.psm1 index 27b0e493e4c..ec95e071bf7 100644 --- a/build.psm1 +++ b/build.psm1 @@ -273,7 +273,7 @@ function Test-IsReleaseCandidate return $false } -$optimizedFddRegex = 'fxdependent-(linux|linux-musl|win|win7|osx)-(x64|x86|arm64|arm)' +$optimizedFddRegex = 'fxdependent-(linux|win|win7|osx)-(x64|x86|arm64|arm)' function Start-PSBuild { [CmdletBinding(DefaultParameterSetName="Default")] @@ -309,7 +309,7 @@ function Start-PSBuild { # If this parameter is not provided it will get determined automatically. [ValidateSet("linux-musl-x64", "fxdependent", - "fxdependent-linux-musl-x64", + "fxdependent-noopt-linux-musl-x64", "fxdependent-linux-x64", "fxdependent-linux-arm64", "fxdependent-win-desktop", @@ -563,7 +563,7 @@ Fix steps: Write-Verbose "Building with shim" -Verbose $globalToolSrcFolder = Resolve-Path (Join-Path $Options.Top "../Microsoft.PowerShell.GlobalTool.Shim") | Select-Object -ExpandProperty Path - if ($Options.Runtime -eq 'fxdependent') { + if ($Options.Runtime -eq 'fxdependent' -or $Options.Runtime -eq 'fxdependent-noopt-linux-musl-x64') { $Arguments += "/property:SDKToUse=Microsoft.NET.Sdk" } elseif ($Options.Runtime -eq 'fxdependent-win-desktop') { $Arguments += "/property:SDKToUse=Microsoft.NET.Sdk.WindowsDesktop" @@ -900,7 +900,7 @@ function New-PSOptions { [ValidateSet("", "linux-musl-x64", "fxdependent", - "fxdependent-linux-musl-x64", + "fxdependent-noopt-linux-musl-x64", "fxdependent-linux-x64", "fxdependent-linux-arm64", "fxdependent-win-desktop", diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index e40e8446308..e3868ecc744 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -115,7 +115,7 @@ function Start-PSPackage { New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-arm64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-alpine-fxdependent") { - New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-musl-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } + New-PSOptions -Configuration "Release" -Runtime 'fxdependent-noopt-linux-musl-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } else { New-PSOptions -Configuration "Release" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } @@ -456,11 +456,11 @@ function Start-PSPackage { $Arguments = @{ PackageSourcePath = $Source Name = $Name - PackageNameSuffix = 'alpine-fxdependent' + PackageNameSuffix = 'musl-noopt-fxdependent' Version = $Version Force = $Force R2RVerification = [R2RVerification]@{ - R2RState = 'R2R' + R2RState = 'NoR2R' OperatingSystem = "Linux" } } @@ -594,7 +594,7 @@ function Start-PSPackage { Name = $Name Version = $Version Force = $Force - Architecture = "linux-musl-x64" + Architecture = "musl-x64" ExcludeSymbolicLinks = $true R2RVerification = [R2RVerification]@{ R2RState = 'R2R' @@ -4606,7 +4606,7 @@ function Invoke-AzDevOpsLinuxPackageBuild { Remove-Item -Path $binDir -Recurse -Force } - $buildParams['Runtime'] = 'fxdependent-linux-musl-x64' + $buildParams['Runtime'] = 'fxdependent-noopt-linux-musl-x64' $buildFolder = "${env:SYSTEM_ARTIFACTSDIRECTORY}/${amd64AlpineFxdBuildFolder}" Start-PSBuild -Clean @buildParams @releaseTagParam -Output $buildFolder -PSOptionsPath "${buildFolder}-meta/psoptions.json" # Remove symbol files, xml document files. diff --git a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 index ae04aed5ea3..2475dce7d89 100644 --- a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 @@ -59,7 +59,7 @@ function BuildPackages { $buildParams.Add("Runtime", "fxdependent") } elseif ($Alpine.IsPresent) { $projectAssetsZipName = 'linuxAlpineProjectAssetssymbols.zip' - $buildParams.Add("Runtime", 'linux-musl-x64') + $buildParams.Add("Runtime", 'musl-x64') } else { # make the artifact name unique $projectAssetsZipName = "linuxProjectAssets-$((Get-Date).Ticks)-symbols.zip" diff --git a/tools/releaseBuild/azureDevOps/templates/nuget.yml b/tools/releaseBuild/azureDevOps/templates/nuget.yml index 749956682d3..247e91013a3 100644 --- a/tools/releaseBuild/azureDevOps/templates/nuget.yml +++ b/tools/releaseBuild/azureDevOps/templates/nuget.yml @@ -111,7 +111,7 @@ jobs: - task: ExtractFiles@1 displayName: 'Extract files alpine-fxdependent' inputs: - archiveFilePatterns: '$(System.ArtifactsDirectory)/packages/powershell-*-linux-x64-alpine-fxdependent.tar.gz' + archiveFilePatterns: '$(System.ArtifactsDirectory)/packages/powershell-*-linux-x64-musl-noopt-fxdependent.tar.gz' destinationFolder: '$(alpineFxdPath)' - template: SetVersionVariables.yml diff --git a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml index a00ac4a8573..1fb5364302b 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml @@ -44,7 +44,7 @@ steps: - pwsh: | $message = @() Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -filter *.tar.gz | ForEach-Object { - if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-linux-musl)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-alpine\-fxdependent)\.(tar\.gz)') + if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-musl)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-musl\-fxdependent)\.(tar\.gz)') { $messageInstance = "$($_.Name) is not a valid package name" $message += $messageInstance From 2e0d46c97b1fcdba85815c441730d3f7116a756a Mon Sep 17 00:00:00 2001 From: Michael D Date: Tue, 10 Oct 2023 09:21:55 +0200 Subject: [PATCH 0061/1168] Clarify some comments/documentation (#20462) --- .../host/msh/Executor.cs | 69 +++++++++---------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs index 2a93fe02afc..38924f3e397 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs @@ -13,11 +13,11 @@ namespace Microsoft.PowerShell { /// - /// Executor wraps a Pipeline instance, and provides helper methods for executing commands in that pipeline. It is used to + /// Executor wraps a Pipeline instance, and provides helper methods for executing commands in that pipeline. It is used to /// provide bookkeeping and structure to the use of pipeline in such a way that they can be interrupted and cancelled by a - /// break event handler, and track nesting of pipelines (which happens with interrupted input loops (aka subshells) and use - /// of tab-completion in prompts. The bookkeeping is necessary because the break handler is static and global, and there is - /// no means for tying a break handler to an instance of an object. + /// break event handler, and to track nesting of pipelines (which happens with interrupted input loops (aka subshells) and + /// use of tab-completion in prompts). The bookkeeping is necessary because the break handler is static and global, and + /// there is no means for tying a break handler to an instance of an object. /// /// The class' instance methods manage a single pipeline. The class' static methods track the outstanding instances to /// ensure that only one instance is 'active' (and therefore cancellable) at a time. @@ -44,8 +44,8 @@ internal enum ExecutionOptions /// /// /// True if the instance will be used to execute the prompt function, which will delay stopping the pipeline by some - /// milliseconds. This we prevent us from stopping the pipeline so quickly that when the user leans on the ctrl-c key - /// that the prompt "stops working" (because it is being stopped faster than it can run to completion). + /// milliseconds. This will prevent us from stopping the pipeline so quickly that, when the user leans on the ctrl-c + /// key, the prompt "stops working" (because it is being stopped faster than it can run to completion). /// internal Executor(ConsoleHost parent, bool useNestedPipelines, bool isPromptFunctionExecutor) { @@ -67,7 +67,7 @@ private void OutputObjectStreamHandler(object sender, EventArgs e) PipelineReader reader = (PipelineReader)sender; - // we use NonBlockingRead instead of Read, as Read would block if the reader has no objects. While it would be + // We use NonBlockingRead instead of Read, as Read would block if the reader has no objects. While it would be // inconsistent for this method to be called when there are no objects, since it will be called synchronously on // the pipeline thread, blocking in this call until an object is streamed would deadlock the pipeline. So we // prefer to take no chance of blocking. @@ -80,7 +80,6 @@ private void OutputObjectStreamHandler(object sender, EventArgs e) } // called on the pipeline thread - private void ErrorObjectStreamHandler(object sender, EventArgs e) { // e is just an empty instance of EventArgs, so we ignore it. sender is the PipelineReader that raised it's @@ -88,7 +87,7 @@ private void ErrorObjectStreamHandler(object sender, EventArgs e) PipelineReader reader = (PipelineReader)sender; - // we use NonBlockingRead instead of Read, as Read would block if the reader has no objects. While it would be + // We use NonBlockingRead instead of Read, as Read would block if the reader has no objects. While it would be // inconsistent for this method to be called when there are no objects, since it will be called synchronously on // the pipeline thread, blocking in this call until an object is streamed would deadlock the pipeline. So we // prefer to take no chance of blocking. @@ -101,7 +100,7 @@ private void ErrorObjectStreamHandler(object sender, EventArgs e) } /// - /// This method handles the failure in executing pipeline asynchronously. + /// This method handles failures in executing the pipeline asynchronously. /// /// private void AsyncPipelineFailureHandler(Exception ex) @@ -110,8 +109,8 @@ private void AsyncPipelineFailureHandler(Exception ex) if (ex is IContainsErrorRecord cer) { er = cer.ErrorRecord; - // Exception inside the error record is ParentContainsErrorRecordException which - // doesn't have stack trace. Replace it with top level exception. + // The exception inside the error record is ParentContainsErrorRecordException, which + // doesn't have a stack trace. Replace it with the top level exception. er = new ErrorRecord(er, ex); } @@ -228,9 +227,9 @@ internal void ExecuteCommandAsyncHelper(Pipeline tempPipeline, out Exception exc } catch (PipelineClosedException) { - // This exception can occurs when input is closed. This can happen - // for various reasons. For ex:Command in the pipeline is invalid and - // command discovery throws exception which closes the pipeline and + // This Exception can occur when the input is closed. This can happen + // for various reasons. For example: The command in the pipeline is invalid and + // command discovery throws an exception, which closes the pipeline and // hence the Input pipe. break; } @@ -293,25 +292,25 @@ internal Pipeline CreatePipeline(string command, bool addToHistory) /// /// All calls to the Runspace to execute a command line must be done with this function, which properly synchronizes - /// access to the running pipeline between the main thread and the break handler thread. This synchronization is + /// access to the running pipeline between the main thread and the break handler thread. This synchronization is /// necessary so that executions can be aborted with Ctrl-C (including evaluation of the prompt and collection of - /// command-completion candidates. + /// command-completion candidates). /// /// On any given Executor instance, ExecuteCommand should be called at most once at a time by any one thread. It is NOT /// reentrant. /// /// - /// The command line to be executed. Must be non-null. + /// The command line to be executed. Must be non-null. /// /// /// Receives the Exception thrown by the execution of the command, if any. If no exception is thrown, then set to null. /// Can be tested to see if the execution was successful or not. /// /// - /// options to govern the execution + /// Options to govern the execution /// /// - /// the object stream resulting from the execution. May be null. + /// The object stream resulting from the execution. May be null. /// internal Collection ExecuteCommand(string command, out Exception exceptionThrown, ExecutionOptions options) { @@ -441,14 +440,14 @@ internal Collection ExecuteCommand(string command) } /// - /// Executes a command (by calling this.ExecuteCommand), and coerces the first result object to a string. Any Exception - /// thrown in the course of execution is returned thru the exceptionThrown parameter. + /// Executes a command (by calling this.ExecuteCommand), and coerces the first result object to a string. Any Exception + /// thrown in the course of execution is returned through the exceptionThrown parameter. /// /// - /// The command to execute. May be any valid monad command. + /// The command to execute. May be any valid monad command. /// /// - /// Receives the Exception thrown by the execution of the command, if any. If no exception is thrown, then set to null. + /// Receives the Exception thrown by the execution of the command, if any. Set to null if no exception is thrown. /// Can be tested to see if the execution was successful or not. /// /// @@ -493,11 +492,11 @@ internal string ExecuteCommandAndGetResultAsString(string command, out Exception } /// - /// Executes a command (by calling this.ExecuteCommand), and coerces the first result object to a bool. Any Exception + /// Executes a command (by calling this.ExecuteCommand), and coerces the first result object to a bool. Any Exception /// thrown in the course of execution is caught and ignored. /// /// - /// The command to execute. May be any valid monad command. + /// The command to execute. May be any valid monad command. /// /// /// The Nullable`bool representation of the first result object returned, or null if an exception was thrown or no @@ -511,14 +510,14 @@ internal string ExecuteCommandAndGetResultAsString(string command, out Exception } /// - /// Executes a command (by calling this.ExecuteCommand), and coerces the first result object to a bool. Any Exception - /// thrown in the course of execution is returned thru the exceptionThrown parameter. + /// Executes a command (by calling this.ExecuteCommand), and coerces the first result object to a bool. Any Exception + /// thrown in the course of execution is returned through the exceptionThrown parameter. /// /// - /// The command to execute. May be any valid monad command. + /// The command to execute. May be any valid monad command. /// /// - /// Receives the Exception thrown by the execution of the command, if any. If no exception is thrown, then set to null. + /// Receives the Exception thrown by the execution of the command, if any. Set to null if no exception is thrown. /// Can be tested to see if the execution was successful or not. /// /// @@ -557,7 +556,7 @@ internal string ExecuteCommandAndGetResultAsString(string command, out Exception } /// - /// Cancels execution of the current instance. If the current instance is not running, then does nothing. Called in + /// Cancels execution of the current instance. Does nothing if the current instance is not running. Called in /// response to a break handler, by the static Executor.Cancel method. /// private void Cancel() @@ -601,7 +600,7 @@ internal void ResumeCommandOutput() } /// - /// Resets the instance to its post-ctor state. Does not cancel execution. + /// Resets the instance to its post-ctor state. Does not cancel execution. /// private void Reset() { @@ -617,7 +616,7 @@ private void Reset() /// handler is triggered and calls the static Cancel method. /// /// - /// The instance to make current. Null is allowed. + /// The instance to make current. Null is allowed. /// /// /// Here are some state-transition cases to illustrate the use of CurrentExecutor @@ -679,8 +678,8 @@ internal static Executor CurrentExecutor } /// - /// Cancels the execution of the current instance (the instance last passed to PushCurrentExecutor), if any. If no - /// instance is Current, then does nothing. + /// Cancels the execution of the current instance (the instance last passed to PushCurrentExecutor), if any. Does + /// nothing if no instance is Current. /// internal static void CancelCurrentExecutor() { From ea01a28490204f79eeb22566b2a1fd6d428fe243 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 10 Oct 2023 13:15:18 -0700 Subject: [PATCH 0062/1168] Update `README.md` and `metadata.json` for 7.2.15 and 7.3.8 releases (#20332) --- README.md | 54 ++++++++++++++++++++++----------------------- tools/metadata.json | 6 ++--- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 7d5fa832dcb..77d8adf266f 100644 --- a/README.md +++ b/README.md @@ -64,33 +64,33 @@ You can also download the PowerShell binary archives for Windows, macOS and Linu | Windows (ARM) | [64-bit][rl-winarm64] (preview) | [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-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.14/PowerShell-7.2.14-win-x86.msi -[lts-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.14/PowerShell-7.2.14-win-x64.msi -[lts-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.14/powershell-lts_7.2.14-1.deb_amd64.deb -[lts-rh]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.14/powershell-lts-7.2.14-1.rh.x86_64.rpm -[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.14/powershell-lts-7.2.14-osx-x64.pkg -[lts-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.14/powershell-lts-7.2.14-osx-arm64.pkg - -[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-x64.msi -[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-x86.msi -[rl-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell_7.3.7-1.deb_amd64.deb -[rl-ubuntu22]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell_7.3.7-1.deb_amd64.deb -[rl-ubuntu20]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell_7.3.7-1.deb_amd64.deb -[rl-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell_7.3.7-1.deb_amd64.deb -[rl-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell_7.3.7-1.deb_amd64.deb -[rl-debian11]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell_7.3.7-1.deb_amd64.deb -[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-1.rh.x86_64.rpm -[rl-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-1.rh.x86_64.rpm -[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-osx-x64.pkg -[rl-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-osx-arm64.pkg -[rl-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-arm64.zip -[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-x86.zip -[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-x64.zip -[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-osx-x64.tar.gz -[rl-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-osx-arm64.tar.gz -[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-linux-x64.tar.gz -[rl-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-linux-arm32.tar.gz -[rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-linux-arm64.tar.gz +[lts-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.15/PowerShell-7.2.15-win-x86.msi +[lts-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.15/PowerShell-7.2.15-win-x64.msi +[lts-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.15/powershell-lts_7.2.15-1.deb_amd64.deb +[lts-rh]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.15/powershell-lts-7.2.15-1.rh.x86_64.rpm +[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.15/powershell-lts-7.2.15-osx-x64.pkg +[lts-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.15/powershell-lts-7.2.15-osx-arm64.pkg + +[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/PowerShell-7.3.8-win-x64.msi +[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/PowerShell-7.3.8-win-x86.msi +[rl-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell_7.3.8-1.deb_amd64.deb +[rl-ubuntu22]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell_7.3.8-1.deb_amd64.deb +[rl-ubuntu20]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell_7.3.8-1.deb_amd64.deb +[rl-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell_7.3.8-1.deb_amd64.deb +[rl-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell_7.3.8-1.deb_amd64.deb +[rl-debian11]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell_7.3.8-1.deb_amd64.deb +[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-1.rh.x86_64.rpm +[rl-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-1.rh.x86_64.rpm +[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-osx-x64.pkg +[rl-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-osx-arm64.pkg +[rl-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/PowerShell-7.3.8-win-arm64.zip +[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/PowerShell-7.3.8-win-x86.zip +[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/PowerShell-7.3.8-win-x64.zip +[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-osx-x64.tar.gz +[rl-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-osx-arm64.tar.gz +[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-linux-x64.tar.gz +[rl-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-linux-arm32.tar.gz +[rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-linux-arm64.tar.gz [rl-snap]: https://snapcraft.io/powershell [pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/PowerShell-7.4.0-preview.6-win-x64.msi diff --git a/tools/metadata.json b/tools/metadata.json index e76f7f87953..5b20967dca0 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,9 +1,9 @@ { - "StableReleaseTag": "v7.3.7", + "StableReleaseTag": "v7.3.8", "PreviewReleaseTag": "v7.4.0-preview.6", "ServicingReleaseTag": "v7.0.13", - "ReleaseTag": "v7.3.7", - "LTSReleaseTag" : ["v7.2.14"], + "ReleaseTag": "v7.3.8", + "LTSReleaseTag" : ["v7.2.15"], "NextReleaseTag": "v7.4.0-preview.7", "LTSRelease": { "Latest": false, "Package": false }, "StableRelease": { "Latest": false, "Package": false } From 81a7f6f621e2ebbb465449a5dee65437c9b36f10 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Wed, 11 Oct 2023 16:54:54 -0700 Subject: [PATCH 0063/1168] Fix `unixmode` to handle `setuid` and `sticky` when file is not an executable (#20366) --- .../CoreCLR/CorePsPlatform.cs | 109 ++++++++---------- .../UnixStat.Tests.ps1 | 15 ++- 2 files changed, 61 insertions(+), 63 deletions(-) diff --git a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs index 783afe62915..dc5db5f2c48 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs @@ -594,82 +594,69 @@ public class CommonStat private const char CanRead = 'r'; private const char CanWrite = 'w'; private const char CanExecute = 'x'; - - // helper for getting unix mode - private readonly Dictionary modeMap = new() - { - { StatMask.OwnerRead, CanRead }, - { StatMask.OwnerWrite, CanWrite }, - { StatMask.OwnerExecute, CanExecute }, - { StatMask.GroupRead, CanRead }, - { StatMask.GroupWrite, CanWrite }, - { StatMask.GroupExecute, CanExecute }, - { StatMask.OtherRead, CanRead }, - { StatMask.OtherWrite, CanWrite }, - { StatMask.OtherExecute, CanExecute }, - }; - - private readonly StatMask[] permissions = new StatMask[] - { - StatMask.OwnerRead, - StatMask.OwnerWrite, - StatMask.OwnerExecute, - StatMask.GroupRead, - StatMask.GroupWrite, - StatMask.GroupExecute, - StatMask.OtherRead, - StatMask.OtherWrite, - StatMask.OtherExecute - }; + private const char NoPerm = '-'; + private const char SetAndExec = 's'; + private const char SetAndNotExec = 'S'; + private const char StickyAndExec = 't'; + private const char StickyAndNotExec = 'T'; // The item type and the character representation for the first element in the stat string - private readonly Dictionary itemTypeTable = new() + private static readonly Dictionary itemTypeTable = new() { - { ItemType.BlockDevice, 'b' }, + { ItemType.BlockDevice, 'b' }, { ItemType.CharacterDevice, 'c' }, - { ItemType.Directory, 'd' }, - { ItemType.File, '-' }, - { ItemType.NamedPipe, 'p' }, - { ItemType.Socket, 's' }, - { ItemType.SymbolicLink, 'l' }, + { ItemType.Directory, 'd' }, + { ItemType.File, '-' }, + { ItemType.NamedPipe, 'p' }, + { ItemType.Socket, 's' }, + { ItemType.SymbolicLink, 'l' }, }; + // We'll create a few common mode strings here to reduce allocations and improve performance a bit. + private const string OwnerReadGroupReadOtherRead = "-r--r--r--"; + private const string OwnerReadWriteGroupReadOtherRead = "-rw-r--r--"; + private const string DirectoryOwnerFullGroupReadExecOtherReadExec = "drwxr-xr-x"; + /// Convert the mode to a string which is usable in our formatting. /// The mode converted into a Unix style string similar to the output of ls. public string GetModeString() { - int offset = 0; - char[] modeCharacters = new char[10]; - modeCharacters[offset++] = itemTypeTable[ItemType]; + // On an Ubuntu system (docker), these 3 are roughly 70% of all the permissions + if ((Mode & 0xFFF) == 292) + { + return OwnerReadGroupReadOtherRead; + } - foreach (StatMask permission in permissions) + if ((Mode & 0xFFF) == 420) { - // determine whether we are setuid, sticky, or the usual rwx. - if ((Mode & (int)permission) == (int)permission) - { - if ((permission == StatMask.OwnerExecute && IsSetUid) || (permission == StatMask.GroupExecute && IsSetGid)) - { - // Check for setuid and add 's' - modeCharacters[offset] = 's'; - } - else if (permission == StatMask.OtherExecute && IsSticky && (ItemType == ItemType.Directory)) - { - // Directories are sticky, rather than setuid - modeCharacters[offset] = 't'; - } - else - { - modeCharacters[offset] = modeMap[permission]; - } - } - else - { - modeCharacters[offset] = '-'; - } + return OwnerReadWriteGroupReadOtherRead; + } - offset++; + if (ItemType == ItemType.Directory & (Mode & 0xFFF) == 493) + { + return DirectoryOwnerFullGroupReadExecOtherReadExec; } + Span modeCharacters = stackalloc char[10]; + modeCharacters[0] = itemTypeTable[ItemType]; + bool isExecutable; + + UnixFileMode modeInfo = (UnixFileMode)Mode; + modeCharacters[1] = modeInfo.HasFlag(UnixFileMode.UserRead) ? CanRead : NoPerm; + modeCharacters[2] = modeInfo.HasFlag(UnixFileMode.UserWrite) ? CanWrite : NoPerm; + isExecutable = modeInfo.HasFlag(UnixFileMode.UserExecute); + modeCharacters[3] = modeInfo.HasFlag(UnixFileMode.SetUser) ? (isExecutable ? SetAndExec : SetAndNotExec) : (isExecutable ? CanExecute : NoPerm); + + modeCharacters[4] = modeInfo.HasFlag(UnixFileMode.GroupRead) ? CanRead : NoPerm; + modeCharacters[5] = modeInfo.HasFlag(UnixFileMode.GroupWrite) ? CanWrite : NoPerm; + isExecutable = modeInfo.HasFlag(UnixFileMode.GroupExecute); + modeCharacters[6] = modeInfo.HasFlag(UnixFileMode.SetGroup) ? (isExecutable ? SetAndExec : SetAndNotExec) : (isExecutable ? CanExecute : NoPerm); + + modeCharacters[7] = modeInfo.HasFlag(UnixFileMode.OtherRead) ? CanRead : NoPerm; + modeCharacters[8] = modeInfo.HasFlag(UnixFileMode.OtherWrite) ? CanWrite : NoPerm; + isExecutable = modeInfo.HasFlag(UnixFileMode.OtherExecute); + modeCharacters[9] = modeInfo.HasFlag(UnixFileMode.StickyBit) ? (isExecutable ? StickyAndExec : StickyAndNotExec) : (isExecutable ? CanExecute : NoPerm); + return new string(modeCharacters); } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 index b14df30e7e2..fcefb707a2e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 @@ -37,6 +37,10 @@ Describe "UnixFileSystem additions" -Tag "CI" { @{ Mode = '555'; Perm = '-r-xr-xr-x'; Item = "${testFile}" }, @{ Mode = '666'; Perm = '-rw-rw-rw-'; Item = "${testFile}" }, @{ Mode = '777'; Perm = '-rwxrwxrwx'; Item = "${testFile}" }, + @{ Mode = '4644'; Perm = '-rwSr--r--'; Item = "${testFile}" }, + @{ Mode = '1644'; Perm = '-rw-r--r-T'; Item = "${testFile}" }, + @{ Mode = '2644'; Perm = '-rw-r-Sr--'; Item = "${testFile}" }, + @{ Mode = '7644'; Perm = '-rwSr-Sr-T'; Item = "${testFile}" }, @{ Mode = '4777'; Perm = '-rwsrwxrwx'; Item = "${testFile}" }, @{ Mode = '1777'; Perm = 'drwxrwxrwt'; Item = "${testDir}" } } @@ -57,9 +61,16 @@ Describe "UnixFileSystem additions" -Tag "CI" { It "Should present filemode '' string correctly as ''" -testCase $testCase { param ($Mode, $Perm, $Item ) + # chmod can fail for some modes so be sure to handle that here. + # specifically, when setting setgid chmod can fail if the group is privileged. chmod "$Mode" "${Item}" - $i = Get-Item $Item - $i.UnixMode | Should -Be $Perm + if ($LASTEXITCODE -ne 0) { + set-itresult -skip -because "chmod '$mode' failed" + } + else { + $i = Get-Item $Item + $i.UnixMode | Should -BeExactly $Perm + } } It "Should retrieve the user name for the file" { From a1349e331ef2b8ed917475981c857dabe1a2d2c0 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Thu, 12 Oct 2023 00:33:51 -0500 Subject: [PATCH 0064/1168] Add HelpUri to Remove-Service (#20476) --- .../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 7f35e88a854..ec6e8062dd0 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs @@ -2350,7 +2350,7 @@ protected override void BeginProcessing() /// /// This class implements the Remove-Service command. /// - [Cmdlet(VerbsCommon.Remove, "Service", SupportsShouldProcess = true, DefaultParameterSetName = "Name")] + [Cmdlet(VerbsCommon.Remove, "Service", SupportsShouldProcess = true, DefaultParameterSetName = "Name", HelpUri = "https://go.microsoft.com/fwlink/?LinkID=2248980")] public class RemoveServiceCommand : ServiceBaseCommand { #region Parameters From 6c96bdc81c714d52f8c658e595ab0a7192f53933 Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Tue, 17 Oct 2023 02:00:32 +0900 Subject: [PATCH 0065/1168] Fix typo in ast.cs (#20492) statments -> statements --- .../engine/parser/ast.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index e9eea85d2ce..f70c028117d 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -790,7 +790,7 @@ public class ScriptBlockAst : Ast, IParameterMetadataProvider /// Construct a ScriptBlockAst that uses explicitly named begin/process/end blocks. /// /// The extent of the script block. - /// The list of using statments, may be null. + /// The list of using statements, may be null. /// The set of attributes for the script block. /// The ast for the param block, may be null. /// The ast for the begin block, may be null. @@ -827,7 +827,7 @@ public ScriptBlockAst(IScriptExtent extent, /// This construction uses explicitly named begin/process/end/clean blocks. /// /// The extent of the script block. - /// The list of using statments, may be null. + /// The list of using statements, may be null. /// The set of attributes for the script block. /// The ast for the param block, may be null. /// The ast for the begin block, may be null. @@ -904,7 +904,7 @@ public ScriptBlockAst( /// Construct a ScriptBlockAst that uses explicitly named begin/process/end blocks. /// /// The extent of the script block. - /// The list of using statments, may be null. + /// The list of using statements, may be null. /// The ast for the param block, may be null. /// The ast for the begin block, may be null. /// The ast for the process block, may be null. @@ -930,7 +930,7 @@ public ScriptBlockAst(IScriptExtent extent, /// This construction uses explicitly named begin/process/end/clean blocks. /// /// The extent of the script block. - /// The list of using statments, may be null. + /// The list of using statements, may be null. /// The ast for the param block, may be null. /// The ast for the begin block, may be null. /// The ast for the process block, may be null. @@ -1008,7 +1008,7 @@ public ScriptBlockAst( /// Construct a ScriptBlockAst that does not use explicitly named blocks. /// /// The extent of the script block. - /// The list of using statments, may be null. + /// The list of using statements, may be null. /// The ast for the param block, may be null. /// /// The statements that go in the end block if is false, or the @@ -1067,7 +1067,7 @@ public ScriptBlockAst(IScriptExtent extent, ParamBlockAst paramBlock, StatementB /// Construct a ScriptBlockAst that does not use explicitly named blocks. /// /// The extent of the script block. - /// The list of using statments, may be null. + /// The list of using statements, may be null. /// The ast for the param block, may be null. /// /// The statements that go in the end block if is false, or the @@ -1109,7 +1109,7 @@ public ScriptBlockAst(IScriptExtent extent, IEnumerable attributes /// Construct a ScriptBlockAst that does not use explicitly named blocks. /// /// The extent of the script block. - /// The list of using statments, may be null. + /// The list of using statements, may be null. /// The attributes for the script block. /// The ast for the param block, may be null. /// From 9543629bfa2bf0609344c8e2a5f718d25ea3f0cb Mon Sep 17 00:00:00 2001 From: Adam Stachowicz Date: Mon, 16 Oct 2023 17:02:38 +0000 Subject: [PATCH 0066/1168] Add 7.3 changelog URL to Readme (#20473) --- CHANGELOG/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG/README.md b/CHANGELOG/README.md index 60ae3af38c4..6595191ce38 100644 --- a/CHANGELOG/README.md +++ b/CHANGELOG/README.md @@ -1,6 +1,7 @@ # Changelogs * [Current preview changelog](preview.md) +* [7.3 changelog](7.3.md) * [7.2 changelog](7.2.md) * [7.1 changelog](7.1.md) * [7.0 changelog](7.0.md) From 42d791f8638590a7cdcc052520c5c8acd9c06534 Mon Sep 17 00:00:00 2001 From: alerickson <25858831+alerickson@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:20:17 -0700 Subject: [PATCH 0067/1168] Bump version of `Microsoft.PowerShell.PSResourceGet` to `v1.0.0` (#20485) --- 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 bcf0db7e092..80a1b7e2022 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -13,7 +13,7 @@ - + From 4fd4522b8493e2c32ec5ee9af0fbc23a2485d9cd Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 16 Oct 2023 12:46:59 -0700 Subject: [PATCH 0068/1168] Suppress error output from `Set-Location` tests (#20499) --- .../Microsoft.PowerShell.Management/Set-Location.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 f8a15d389e3..73f3250ae89 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 @@ -240,7 +240,7 @@ Describe "Set-Location" -Tags "CI" { It 'Should go to the parent folder on cd.. run' { Set-Location 'TestDrive:\' $ParentDir = (Get-Location).path - New-Item -Path 'TestDrive:\' -Name 'Directory1' -ItemType Directory + New-Item -Path 'TestDrive:\' -Name 'Directory1' -ItemType Directory -ErrorAction Ignore Set-Location 'TestDrive:\Directory1' cd.. (Get-Location).Path | Should -BeExactly $ParentDir @@ -256,7 +256,7 @@ Describe "Set-Location" -Tags "CI" { } It 'Should go to root of current drive on cd\ run (Linux/Mac)' -Skip:($IsWindows){ Set-Location 'TestDrive:\' - New-Item -Path 'TestDrive:\Directory1' -Name 'Directory2' -ItemType Directory + New-Item -Path 'TestDrive:\Directory1' -Name 'Directory2' -ItemType Directory -ErrorAction Ignore Set-Location 'TestDrive:\Directory1\Directory2' cd\ (Get-Location).Path | Should -BeExactly "/" From fce4f3e19e22098d6ec70999d472aaae9d2bb041 Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:02:14 -0700 Subject: [PATCH 0069/1168] Update to the latest NOTICES file (#20453) --- ThirdPartyNotices.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index cfda2226963..29e923a74e6 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -238,7 +238,7 @@ SOFTWARE. --------------------------------------------------------- -JsonSchema.Net 5.2.5 - MIT +JsonSchema.Net 5.2.6 - MIT From 635d39ff26950c9bae32ec8fadc73ba6b9da18b5 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Mon, 16 Oct 2023 15:05:56 -0700 Subject: [PATCH 0070/1168] Increase timeout when publishing packages to `pacakages.microsoft.com` (#20470) --- tools/releaseBuild/azureDevOps/releasePipeline.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/releaseBuild/azureDevOps/releasePipeline.yml b/tools/releaseBuild/azureDevOps/releasePipeline.yml index b893a8f5cf9..3e79785de4a 100644 --- a/tools/releaseBuild/azureDevOps/releasePipeline.yml +++ b/tools/releaseBuild/azureDevOps/releasePipeline.yml @@ -341,6 +341,7 @@ stages: - stage: PublishPackages displayName: Publish packages dependsOn: GitHubManualTasks + timeoutInMinutes: 120 jobs: - job: PublishNuget @@ -356,6 +357,7 @@ stages: - job: PublishPkgsMsftCom + timeoutInMinutes: 120 pool: name: PowerShell1ES demands: From 5272720c30e1b03fcd44638120000722e88515f5 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Mon, 16 Oct 2023 15:11:26 -0700 Subject: [PATCH 0071/1168] Only registry App Path for release package (#20478) --- assets/wix/Product.wxs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/wix/Product.wxs b/assets/wix/Product.wxs index b4f9a5f90bd..6f34a33849e 100644 --- a/assets/wix/Product.wxs +++ b/assets/wix/Product.wxs @@ -151,7 +151,9 @@ - + + + @@ -209,13 +211,15 @@ - + + + DISABLE_TELEMETRY From a0e6807bb2389d4dc5c1f400fb3a59e1ed07f2c0 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 16 Oct 2023 15:14:11 -0700 Subject: [PATCH 0072/1168] Add error if invalid `-ExecutionPolicy` is passed to `pwsh` (#20460) --- .../host/msh/CommandLineParameterParser.cs | 11 +++++++++- .../CommandLineParameterParserStrings.resx | 3 +++ test/powershell/Host/ConsoleHost.Tests.ps1 | 6 ++++++ test/xUnit/csharp/test_CommandLineParser.cs | 20 ++++++++++--------- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs index 30106d9a1e7..50d2bd77d0f 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs @@ -1078,7 +1078,16 @@ private void ParseHelper(string[] args) { ParseExecutionPolicy(args, ref i, ref _executionPolicy, CommandLineParameterParserStrings.MissingExecutionPolicyParameter); ParametersUsed |= ParameterBitmap.ExecutionPolicy; - ParametersUsed |= GetExecutionPolicy(_executionPolicy); + var executionPolicy = GetExecutionPolicy(_executionPolicy); + if (executionPolicy == ParameterBitmap.EPIncorrect) + { + SetCommandLineError( + string.Format(CultureInfo.CurrentCulture, CommandLineParameterParserStrings.InvalidExecutionPolicyArgument, _executionPolicy), + showHelp: true); + break; + } + + ParametersUsed |= executionPolicy; } else if (MatchSwitch(switchKey, "encodedcommand", "e") || MatchSwitch(switchKey, "ec", "e")) { diff --git a/src/Microsoft.PowerShell.ConsoleHost/resources/CommandLineParameterParserStrings.resx b/src/Microsoft.PowerShell.ConsoleHost/resources/CommandLineParameterParserStrings.resx index decca21bb00..34bb696c33c 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/resources/CommandLineParameterParserStrings.resx +++ b/src/Microsoft.PowerShell.ConsoleHost/resources/CommandLineParameterParserStrings.resx @@ -222,4 +222,7 @@ Valid formats are: The specified arguments must not contain null elements. + + Invalid ExecutionPolicy value '{0}'. + diff --git a/test/powershell/Host/ConsoleHost.Tests.ps1 b/test/powershell/Host/ConsoleHost.Tests.ps1 index 0ca8978353d..9a546302906 100644 --- a/test/powershell/Host/ConsoleHost.Tests.ps1 +++ b/test/powershell/Host/ConsoleHost.Tests.ps1 @@ -943,6 +943,12 @@ $powershell -c '[System.Management.Automation.Platform]::SelectProductNameForDir $out | Should -Be $expected } } + + It 'Errors for invalid ExecutionPolicy string' { + $out = pwsh -nologo -noprofile -executionpolicy NonExistingExecutionPolicy -c 'exit 0' 2>&1 + $out | Should -Not -BeNullOrEmpty + $LASTEXITCODE | Should -Be $ExitCodeBadCommandLineParameter + } } Describe "WindowStyle argument" -Tag Feature { diff --git a/test/xUnit/csharp/test_CommandLineParser.cs b/test/xUnit/csharp/test_CommandLineParser.cs index 966834fd2b3..5025584d6ac 100644 --- a/test/xUnit/csharp/test_CommandLineParser.cs +++ b/test/xUnit/csharp/test_CommandLineParser.cs @@ -856,22 +856,24 @@ public static void TestParameter_ExecutionPolicy_No_Value(params string[] comman } [Theory] - [InlineData("-executionpolicy", "XML")] - [InlineData("-ex", "XML")] - [InlineData("-ep", "XML")] - public static void TestParameter_ExecutionPolicy_With_Right_Value(params string[] commandLine) + [InlineData("-executionpolicy", "InvalidPolicy")] + [InlineData("-ex", "InvalidPolicy")] + [InlineData("-ep", "InvalidPolicy")] + public static void TestParameter_ExecutionPolicy_With_Wrong_Value(params string[] commandLine) { var cpp = new CommandLineParameterParser(); cpp.Parse(commandLine); - Assert.False(cpp.AbortStartup); + Assert.True(cpp.AbortStartup); Assert.True(cpp.NoExit); - Assert.False(cpp.ShowShortHelp); - Assert.True(cpp.ShowBanner); - Assert.Equal((uint)ConsoleHost.ExitCodeSuccess, cpp.ExitCode); + Assert.True(cpp.ShowShortHelp); + Assert.False(cpp.ShowBanner); + Assert.Equal((uint)ConsoleHost.ExitCodeBadCommandLineParameter, cpp.ExitCode); Assert.Equal(commandLine[1], cpp.ExecutionPolicy); - Assert.Null(cpp.ErrorMessage); + Assert.Equal( + string.Format(CommandLineParameterParserStrings.InvalidExecutionPolicyArgument, "InvalidPolicy"), + cpp.ErrorMessage); } [Theory] From 4621c9e5718393817bd48e9d23f799562a2458ce Mon Sep 17 00:00:00 2001 From: Thomas Nieto <38873752+ThomasNieto@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:26:31 -0500 Subject: [PATCH 0073/1168] Change `New-FileCatalog -CatalogVersion` default to 2 (#20428) --- .../security/CatalogCommands.cs | 2 +- .../FileCatalog.Tests.ps1 | 28 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs b/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs index d96538141d9..4d0cad2d3e9 100644 --- a/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs @@ -160,7 +160,7 @@ public int CatalogVersion } // Based on the Catalog version we will decide which hashing Algorithm to use - private int catalogVersion = 1; + private int catalogVersion = 2; /// /// Generate the Catalog for the Path. diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 index 17fb384cf58..b187dbb43e1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 @@ -70,7 +70,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { try { - $null = New-FileCatalog -Path $sourcePath -CatalogFilePath $catalogPath -CatalogVersion 1.0 + $null = New-FileCatalog -Path $sourcePath -CatalogFilePath $catalogPath -CatalogVersion 1 $result = Test-FileCatalog -Path $sourcePath -CatalogFilePath $catalogPath -Detailed } finally @@ -103,7 +103,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { # Validate result properties $result.Status | Should -Be "Valid" $result.Signature.Status | Should -Be "NotSigned" - $result.HashAlgorithm | Should -Be "SHA1" + $result.HashAlgorithm | Should -Be "SHA256" } It "NewFileCatalogWithSingleFile" { @@ -135,7 +135,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { try { - $null = New-FileCatalog -Path "$testDataPath\TestImage.gif","$testDataPath\TestFileCatalog.txt" -CatalogFilePath $catalogPath -CatalogVersion 1.0 + $null = New-FileCatalog -Path "$testDataPath\TestImage.gif","$testDataPath\TestFileCatalog.txt" -CatalogFilePath $catalogPath -CatalogVersion 1 $result = Test-FileCatalog -Path "$testDataPath\TestImage.gif","$testDataPath\TestFileCatalog.txt" -CatalogFilePath ($catalogPath + "\catalog.cat") -Detailed } finally @@ -170,7 +170,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { try { - $null =New-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -CatalogVersion 1.0 + $null =New-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -CatalogVersion 1 $result = Test-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -Detailed } finally @@ -209,7 +209,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { try { - $null = New-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -CatalogVersion 2.0 + $null = New-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -CatalogVersion 2 $result = Test-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -Detailed } finally @@ -235,7 +235,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { 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 + $null = New-FileCatalog -CatalogFilePath $catalogPath -CatalogVersion 1 $result = Test-FileCatalog -CatalogFilePath $catalogPath if($result -ne 'Valid') @@ -286,7 +286,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { try { - $null = New-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -CatalogVersion 2.0 + $null = New-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -CatalogVersion 2 $result = Test-FileCatalog -Path $catalogDataPath -CatalogFilePath $catalogPath -Detailed } finally @@ -315,7 +315,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { It "TestCatalogWhenNewFileAddedtoFolderBeforeValidation" { $script:catalogPath = "$env:TEMP\TestCatalogWhenNewFileAddedtoFolderBeforeValidation.cat" - $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 2.0 + $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 2 $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 @@ -335,7 +335,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { It "TestCatalogWhenNewFileDeletedFromFolderBeforeValidation" { $script:catalogPath = "$env:TEMP\TestCatalogWhenNewFileDeletedFromFolderBeforeValidation.cat" - $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1.0 + $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1 $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 @@ -354,7 +354,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { It "TestCatalogWhenFileContentModifiedBeforeValidation" { $script:catalogPath = "$env:TEMP\TestCatalogWhenFileContentModifiedBeforeValidation.cat" - $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1.0 + $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1 $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 @@ -381,7 +381,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { It "TestCatalogSkipSingleFileDuringValidation" { $script:catalogPath = "$env:TEMP\TestCatalogSkipSingleFileDuringValidation.cat" - $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 2.0 + $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 2 $result = Test-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -FilesToSkip "scriptdsc.schema" $result | Should -Be "Valid" } @@ -389,7 +389,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { It "TestCatalogSkipCertainFileTypeDuringValidation" { $script:catalogPath = "$env:TEMP\TestCatalogSkipCertainFileTypeDuringValidation.cat" - $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 2.0 + $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 2 $result = Test-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -FilesToSkip "*.mof" $result | Should -Be "Valid" } @@ -397,7 +397,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { It "TestCatalogSkipWildCardPatternDuringValidation" { $script:catalogPath = "$env:TEMP\TestCatalogSkipWildCardPatternDuringValidation.cat" - $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1.0 + $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1 $result = Test-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -FilesToSkip "UserConfigProvider*.psm1" $result | Should -Be "Valid" } @@ -405,7 +405,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { It "TestCatalogSkipMultiplePattensDuringValidation" { $script:catalogPath = "$env:TEMP\TestCatalogSkipMultiplePattensDuringValidation.cat" - $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1.0 + $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1 $result = Test-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -FilesToSkip "*.psd1","UserConfigProviderModVersion2.psm1","*ModVersion1.schema.mof" $result | Should -Be "Valid" } From 2e5bd015c31f2574de16b5095364ff7fd6603047 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 16 Oct 2023 15:31:56 -0700 Subject: [PATCH 0074/1168] Add telemetry to check for specific tags when importing a module (#20371) --- .../engine/Modules/ImportModuleCommand.cs | 10 ++-- .../utils/Telemetry.cs | 59 +++++++++++++++++-- 2 files changed, 58 insertions(+), 11 deletions(-) diff --git a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs index dbbbf7286ae..15e8bfe6a9a 100644 --- a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs @@ -619,7 +619,7 @@ private PSModuleInfo ImportModule_LocallyViaName_WithTelemetry(ImportModuleOptio // avoid double reporting for WinCompat modules that go through CommandDiscovery\AutoloadSpecifiedModule if (!foundModule.IsWindowsPowerShellCompatModule) { - ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, foundModule.Name, foundModule.Version?.ToString()); + ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, foundModule); #if LEGACYTELEMETRY TelemetryAPI.ReportModuleLoad(foundModule); #endif @@ -893,7 +893,7 @@ private PSModuleInfo ImportModule_LocallyViaFQName(ImportModuleOptions importMod if (foundModule != null) { - ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, foundModule.Name, foundModule.Version?.ToString()); + ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, foundModule); SetModuleBaseForEngineModules(foundModule.Name, this.Context); } @@ -935,7 +935,7 @@ private IList ImportModule_RemotelyViaPsrpSession( // Send telemetry on the imported modules foreach (PSModuleInfo moduleInfo in remotelyImportedModules) { - ApplicationInsightsTelemetry.SendModuleTelemetryMetric(usingWinCompat ? TelemetryType.WinCompatModuleLoad : TelemetryType.ModuleLoad, moduleInfo.Name, moduleInfo.Version?.ToString()); + ApplicationInsightsTelemetry.SendModuleTelemetryMetric(usingWinCompat ? TelemetryType.WinCompatModuleLoad : TelemetryType.ModuleLoad, moduleInfo); } return remotelyImportedModules; @@ -1866,7 +1866,7 @@ protected override void ProcessRecord() // of doing Get-Module -list foreach (PSModuleInfo module in ModuleInfo) { - ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, module.Name, module.Version?.ToString()); + ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, module); RemoteDiscoveryHelper.DispatchModuleInfoProcessing( module, localAction: () => @@ -1926,7 +1926,7 @@ protected override void ProcessRecord() ImportModule_RemotelyViaPsrpSession(importModuleOptions, null, FullyQualifiedName, this.PSSession); foreach (ModuleSpecification modulespec in FullyQualifiedName) { - ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, modulespec.Name, modulespec.Version?.ToString()); + ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, modulespec.Name); } } else if (this.ParameterSetName.Equals(ParameterSet_ViaWinCompat, StringComparison.OrdinalIgnoreCase) diff --git a/src/System.Management.Automation/utils/Telemetry.cs b/src/System.Management.Automation/utils/Telemetry.cs index a1c3d324b5d..5588cb103a7 100644 --- a/src/System.Management.Automation/utils/Telemetry.cs +++ b/src/System.Management.Automation/utils/Telemetry.cs @@ -5,11 +5,14 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Management.Automation; using System.Runtime.InteropServices; +using System.Security.AccessControl; using System.Threading; using Microsoft.ApplicationInsights; +using Microsoft.ApplicationInsights.Metrics; using Microsoft.ApplicationInsights.Channel; using Microsoft.ApplicationInsights.Extensibility; using Microsoft.ApplicationInsights.Extensibility.Implementation; @@ -124,6 +127,9 @@ public static class ApplicationInsightsTelemetry // Use '0.0' as the string for an anonymous module version private const string AnonymousVersion = "0.0"; + // Use 'n/a' as the string when there's no tag to report + private const string NoTag = "n/a"; + // the telemetry failure string private const string _telemetryFailure = "TELEMETRY_FAILURE"; @@ -140,9 +146,11 @@ public static class ApplicationInsightsTelemetry 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. + /// We send telemetry only a known set of modules and tags. + /// If it's not in the list (initialized in the static constructor), then we report anonymous + /// or don't report anything (in the case of tags). private static readonly HashSet s_knownModules; + private static readonly HashSet s_knownModuleTags; /// Gets a value indicating whether telemetry can be sent. public static bool CanSendTelemetry { get; private set; } = false; @@ -601,6 +609,12 @@ static ApplicationInsightsTelemetry() "xWindowsUpdate", }; + // use a hashset when looking for module names, it should be quicker than a string comparison + s_knownModuleTags = new HashSet(StringComparer.OrdinalIgnoreCase) + { + "CrescendoBuilt", + }; + s_uniqueUserIdentifier = GetUniqueIdentifier().ToString(); } } @@ -671,6 +685,41 @@ private static bool GetEnvironmentVariableAsBool(string name, bool defaultValue) return defaultValue; } + /// + /// Send module load telemetry as a metric. + /// For modules we send the module name (if allowed), and the version. + /// Some modules (CIM) will continue use the string alternative method. + /// + /// The type of telemetry that we'll be sending. + /// The module to report. If it is not allowed, then it is set to 'anonymous'. + internal static void SendModuleTelemetryMetric(TelemetryType telemetryType, PSModuleInfo moduleInfo) + { + if (!CanSendTelemetry) + { + return; + } + + // Package up the module name, version, and known tags as a metric. + // Note that the allowed tags will be a comma separated list which will need to + // be handled in the telemetry query. + try + { + string allowedModuleName = GetModuleName(moduleInfo.Name); + string allowedModuleVersion = allowedModuleName == Anonymous ? AnonymousVersion : moduleInfo.Version?.ToString(); + var allowedModuleTags = moduleInfo.Tags.Where(t => s_knownModuleTags.Contains(t)).Distinct(); + string allowedModuleTagString = allowedModuleTags.Any() ? string.Join(',', allowedModuleTags) : NoTag; + + s_telemetryClient. + GetMetric(new MetricIdentifier(string.Empty, telemetryType.ToString(), "uuid", "SessionId", "ModuleName", "Version", "Tag")). + TrackValue(metricValue: 1.0, s_uniqueUserIdentifier, s_sessionId, allowedModuleName, allowedModuleVersion, allowedModuleTagString); + } + catch + { + // Ignore errors. + } + + } + /// /// Send module load telemetry as a metric. /// For modules we send the module name (if allowed), and the version. @@ -678,8 +727,7 @@ private static bool GetEnvironmentVariableAsBool(string name, bool defaultValue) /// /// The type of telemetry that we'll be sending. /// The module name to report. If it is not allowed, then it is set to 'anonymous'. - /// The module version to report. The default value is the anonymous version '0.0.0.0'. - internal static void SendModuleTelemetryMetric(TelemetryType telemetryType, string moduleName, string moduleVersion = AnonymousVersion) + internal static void SendModuleTelemetryMetric(TelemetryType telemetryType, string moduleName) { if (!CanSendTelemetry) { @@ -689,8 +737,7 @@ internal static void SendModuleTelemetryMetric(TelemetryType telemetryType, stri try { string allowedModuleName = GetModuleName(moduleName); - string allowedModuleVersion = allowedModuleName == Anonymous ? AnonymousVersion : moduleVersion; - s_telemetryClient.GetMetric(telemetryType.ToString(), "uuid", "SessionId", "ModuleName", "Version").TrackValue(metricValue: 1.0, s_uniqueUserIdentifier, s_sessionId, allowedModuleName, allowedModuleVersion); + s_telemetryClient.GetMetric(telemetryType.ToString(), "uuid", "SessionId", "ModuleName", "Version").TrackValue(metricValue: 1.0, s_uniqueUserIdentifier, s_sessionId, allowedModuleName, AnonymousVersion); } catch { From 6176fd3fcfe275fac459d41cde2435d111a56587 Mon Sep 17 00:00:00 2001 From: MartinGC94 <42123497+MartinGC94@users.noreply.github.com> Date: Tue, 17 Oct 2023 00:43:48 +0200 Subject: [PATCH 0075/1168] Fix UNC path completion regression (#20419) --- .../CommandCompletion/CompletionCompleters.cs | 21 ++++++++----------- .../TabCompletion/TabCompletion.Tests.ps1 | 5 +++++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index e2220750606..357ce126ab5 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -4629,22 +4629,19 @@ private static List GetFileSystemProviderResults( string basePath; if (!relativePaths) { - string providerName = $"{provider.ModuleName}\\{provider.Name}::"; - if (pathInfo.Path.StartsWith(providerName, StringComparison.OrdinalIgnoreCase)) + if (pathInfo.Drive is null) { - basePath = pathInfo.Path.Substring(providerName.Length); + basePath = dirInfo.FullName; } else { - providerName = $"{provider.Name}::"; - if (pathInfo.Path.StartsWith(providerName, StringComparison.OrdinalIgnoreCase)) - { - basePath = pathInfo.Path.Substring(providerName.Length); - } - else - { - basePath = pathInfo.Path; - } + int stringStartIndex = pathInfo.Drive.Root.EndsWith(provider.ItemSeparator) && pathInfo.Drive.Root.Length > 1 + ? pathInfo.Drive.Root.Length - 1 + : pathInfo.Drive.Root.Length; + + basePath = pathInfo.Drive.VolumeSeparatedByColon + ? string.Concat(pathInfo.Drive.Name, ":", dirInfo.FullName.AsSpan(stringStartIndex)) + : string.Concat(pathInfo.Drive.Name, dirInfo.FullName.AsSpan(stringStartIndex)); } basePath = basePath.EndsWith(provider.ItemSeparator) diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index a6d957f3587..369b5994dcb 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -1276,6 +1276,11 @@ class InheritedClassTest : System.Attribute } } + It 'Should correct slashes in UNC path completion' -Skip:(!$IsWindows) { + $Res = TabExpansion2 -inputScript 'Get-ChildItem //localhost/c$/Windows' + $Res.CompletionMatches[0].CompletionText | Should -Be "'\\localhost\c$\Windows'" + } + It 'Should keep custom drive names when completing file paths' { $TempDriveName = "asdf" $null = New-PSDrive -Name $TempDriveName -PSProvider FileSystem -Root $HOME From 3bf364fd95c449128498438073c4ea6c52a2d0ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:45:26 -0700 Subject: [PATCH 0076/1168] Bump xunit.runner.visualstudio from 2.5.1 to 2.5.3 (#20486) --- 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 8e1b52c7a8c..a5ecd4e5296 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -25,7 +25,7 @@ - + From eba97d46fcc0d167d1320b454ec20c1cfd3ac06f Mon Sep 17 00:00:00 2001 From: Shruti Sen <115914670+shruti-sen2004@users.noreply.github.com> Date: Wed, 18 Oct 2023 09:39:14 +0530 Subject: [PATCH 0077/1168] Update ADOPTERS.md (#20504) batteries- included -> battery-included --- ADOPTERS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ADOPTERS.md b/ADOPTERS.md index e6b274ee4ef..00dce21aa80 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -12,7 +12,7 @@ Example entry: This is a list of adopters using PowerShell in production or in their products (in alphabetical order): -* [Azure Cloud Shell](https://shell.azure.com/) provides a batteries-included browser-based PowerShell environment used by Azure administrators to manage their environment. +* [Azure Cloud Shell](https://shell.azure.com/) provides a battery-included browser-based PowerShell environment used by Azure administrators to manage their environment. It includes up-to-date PowerShell modules for `Azure`, `AzureAD`, `Exchange`, `Teams`, and many more. More information about Azure Cloud Shell is available at [Azure Cloud Shell Overview.](https://learn.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. From 17930e5e4511aa9afddc0b8c584b83575fa46274 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 18 Oct 2023 11:10:25 -0700 Subject: [PATCH 0078/1168] Bump to .NET 8 RC2 (#20510) --- DotnetRuntimeMetadata.json | 8 +++---- global.json | 2 +- ...oft.PowerShell.Commands.Diagnostics.csproj | 2 +- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 ++-- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 22 +++++++++---------- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 16 +++++++------- .../BenchmarkDotNet.Extensions.csproj | 4 ++-- .../ResultsComparer/ResultsComparer.csproj | 2 +- ...soft.PowerShell.NamedPipeConnection.csproj | 2 +- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 ++-- 14 files changed, 37 insertions(+), 37 deletions(-) diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json index 464ca8a6291..5b6ac60b802 100644 --- a/DotnetRuntimeMetadata.json +++ b/DotnetRuntimeMetadata.json @@ -1,13 +1,13 @@ { "sdk": { - "channel": "8.0.1xx-rc1", + "channel": "8.0.1xx-rc2", "quality": "daily", "qualityFallback": "preview", - "packageVersionPattern": "8.0.0-rc.1", + "packageVersionPattern": "8.0.0-rc.2", "sdkImageVersion": "8.0.100", - "nextChannel": "8.0.1xx-preview4", + "nextChannel": "8.0.1xx-rc2", "azureFeed": "", - "sdkImageOverride": "" + "sdkImageOverride": "8.0.100-rc.2.23502.2" }, "internalfeed": { "url": "" diff --git a/global.json b/global.json index adc56119682..3ecc5db745d 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.100-rc.1.23463.5" + "version": "8.0.100-rc.2.23502.2" } } diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj index e3fc9bd3cf3..1e7f70bc8f8 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj @@ -8,7 +8,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 4952214240a..0d6c585478d 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 f7410061a63..31b1082aa9d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -33,8 +33,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 5922c52e366..3c00ae295b8 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 3082c48bc23..85588f8b535 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -19,22 +19,22 @@ - - - + + + - - - - - - + + + + + + - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index 4ab85c79597..084ba8e2ffe 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 2d45cea0f7a..fe97fc5e560 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -34,16 +34,16 @@ - - - - + + + + - + - - - + + + diff --git a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj index 0956c4122c7..2a398dad179 100644 --- a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj +++ b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj b/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj index 0fc80386919..a8b48dde151 100644 --- a/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj +++ b/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj @@ -9,7 +9,7 @@ - + diff --git a/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj b/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj index 6dcec1060f1..b53f1921a73 100644 --- a/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj +++ b/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj @@ -15,6 +15,6 @@ - + diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index 561dac20d1f..396c34ab46a 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 89e69a428fa..5e7fc468c65 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + From 235b5bbe22c0ce351730264f52968ad42d9c5422 Mon Sep 17 00:00:00 2001 From: Aditya Aryaman Das <128703909+alienishi@users.noreply.github.com> Date: Thu, 19 Oct 2023 08:45:55 +0530 Subject: [PATCH 0079/1168] Correct grammatical errors in README.md (#20509) --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 77d8adf266f..281b9ed3353 100644 --- a/README.md +++ b/README.md @@ -3,22 +3,22 @@ Welcome to the PowerShell GitHub Community! [PowerShell](https://learn.microsoft.com/powershell/scripting/overview) is a cross-platform (Windows, Linux, and macOS) automation and configuration tool/framework that works well with your existing tools and is optimized for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models. -It includes a command-line shell, an associated scripting language and a framework for processing cmdlets. +It includes a command-line shell, an associated scripting language, and a framework for processing cmdlets. [logo]: https://raw.githubusercontent.com/PowerShell/PowerShell/master/assets/ps_black_64.svg?sanitize=true ## Windows PowerShell vs. PowerShell Core -Although this repository started as a fork of the Windows PowerShell codebase, changes made in this repository do not make their way back to Windows PowerShell 5.1 automatically. +Although this repository started as a fork of the Windows PowerShell codebase, changes made in this repository are not automatically ported back to Windows PowerShell 5.1. This also means that [issues tracked here][issues] are only for PowerShell Core 6 and higher. -Windows PowerShell specific issues should be reported with the [Feedback Hub app][feedback-hub], by choosing "Apps > PowerShell" in category. +Windows PowerShell specific issues should be reported with the [Feedback Hub app][feedback-hub], by choosing "Apps > PowerShell" in the category. [issues]: https://github.com/PowerShell/PowerShell/issues [feedback-hub]: https://support.microsoft.com/windows/send-feedback-to-microsoft-with-the-feedback-hub-app-f59187f8-8739-22d6-ba93-f66612949332 ## New to PowerShell? -If you are new to PowerShell and would like to learn more, we recommend reviewing the [getting started][] documentation. +If you are new to PowerShell and want to learn more, we recommend reviewing the [getting started][] documentation. [getting started]: https://learn.microsoft.com/powershell/scripting/learn/more-powershell-learning @@ -53,7 +53,7 @@ You can download and install a PowerShell package for any of the following platf | Kali Linux | [.deb][rl-deb] | [.deb][pv-deb] | [Instructions][in-kali] | | Many Linux distributions | [Snapcraft][rl-snap] | [Snapcraft][pv-snap] | | -You can also download the PowerShell binary archives for Windows, macOS and Linux. +You can also download the PowerShell binary archives for Windows, macOS, and Linux. | Platform | Downloads (stable) | Downloads (preview) | How to Install | | ---------------| --------------------------------------------------- | ------------------------------------------------| -----------------------------------------------| @@ -156,7 +156,7 @@ Create or join a [discussion](https://github.com/PowerShell/PowerShell/discussio Want to chat with other members of the PowerShell community? -There are dozens of topic specific channels on our community-driven PowerShell Virtual User Group, which you can join on: +There are dozens of topic-specific channels on our community-driven PowerShell Virtual User Group, which you can join on: * [Gitter](https://gitter.im/PowerShell/PowerShell) * [Discord](https://discord.gg/PowerShell) @@ -198,13 +198,13 @@ If you have any problems building, consult the developer [FAQ][]. ## Downloading the Source Code -You can just clone the repository: +You can clone the repository: ```sh git clone https://github.com/PowerShell/PowerShell.git ``` -See [working with the PowerShell repository](https://github.com/PowerShell/PowerShell/tree/master/docs/git) for more information. +For more information, see [working with the PowerShell repository](https://github.com/PowerShell/PowerShell/tree/master/docs/git). ## Developing and Contributing @@ -249,7 +249,7 @@ The governance policy for the PowerShell project is described [here][]. ## [Code of Conduct][conduct-md] This project has adopted the [Microsoft Open Source Code of Conduct][conduct-code]. -For more information see the [Code of Conduct FAQ][conduct-FAQ] or contact [opencode@microsoft.com][conduct-email] with any additional questions or comments. +For more information, see the [Code of Conduct FAQ][conduct-FAQ] or contact [opencode@microsoft.com][conduct-email] with any additional questions or comments. [conduct-code]: https://opensource.microsoft.com/codeofconduct/ [conduct-FAQ]: https://opensource.microsoft.com/codeofconduct/faq/ From 31cccab3ecf10087555e77abc793f0028992d41a Mon Sep 17 00:00:00 2001 From: Shruti Sen <115914670+shruti-sen2004@users.noreply.github.com> Date: Thu, 19 Oct 2023 22:27:20 +0530 Subject: [PATCH 0080/1168] Fix typo in ADOPTERS.md (#20520) --- ADOPTERS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ADOPTERS.md b/ADOPTERS.md index 00dce21aa80..79ed1ff81c7 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -29,7 +29,7 @@ This is a list of adopters using PowerShell in production or in their products ( [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://learn.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. + It is 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://learn.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. * [GitHub Actions Python builds](https://github.com/actions/python-versions) GitHub Actions uses PowerShell to automate building Python from source for its runners. From 581ee201a78016325917e5eafad08d168a676c46 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 19 Oct 2023 10:36:47 -0700 Subject: [PATCH 0081/1168] Fix `Copy-Item` progress to only show completed when all files are copied (#20517) --- .../namespaces/FileSystemProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 5704773b738..7236a6f3891 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -3569,7 +3569,7 @@ protected override void CopyItem( } CopyItemLocalOrToSession(path, destinationPath, recurse, Force, null); - if (_totalFiles > 0) + if (Stopping || _copiedFiles == _totalFiles) { _copyStopwatch.Stop(); var progress = new ProgressRecord(COPY_FILE_ACTIVITY_ID, " ", " "); From 8be582b8ca574ad19c15f8f0afb69075c4b95da6 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 19 Oct 2023 10:43:34 -0700 Subject: [PATCH 0082/1168] Block any preview vPack release (#20243) --- tools/releaseBuild/azureDevOps/vpackRelease.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/releaseBuild/azureDevOps/vpackRelease.yml b/tools/releaseBuild/azureDevOps/vpackRelease.yml index e9d1fb286cf..14368ffb8f8 100644 --- a/tools/releaseBuild/azureDevOps/vpackRelease.yml +++ b/tools/releaseBuild/azureDevOps/vpackRelease.yml @@ -45,6 +45,12 @@ stages: ReleaseTagVar: $(ReleaseTagVar) CreateJson: yes UseJson: no + + - powershell: | + if($env:RELEASETAGVAR -match '-') { + throw "Don't release a preview build without coordinating with Windows Engineering Build Tools Team" + } + displayName: Stop any preview release - powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhss"))" displayName: Set Build Name for Non-PR From f7b6df7c737a7463270d5cd9c481fa80ee648558 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Oct 2023 10:45:47 -0700 Subject: [PATCH 0083/1168] Bump Microsoft.Management.Infrastructure (#20512) --- .../System.Management.Automation.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 135b0fcba39..4b756e722aa 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 @@ -8,7 +8,7 @@ 11.0 - + From 6018075344ad31a824d0ab50edea3403fee2664c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Oct 2023 18:21:23 +0000 Subject: [PATCH 0084/1168] Bump Microsoft.Management.Infrastructure (#20511) --- .../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 fe97fc5e560..1568b76ee0e 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -45,7 +45,7 @@ - + From e6ee40c7e89782bf9a47ed5c4fec12725e24bfef Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:33:54 -0700 Subject: [PATCH 0085/1168] Block any preview vPack release (#20243) (#20526) --- tools/releaseBuild/azureDevOps/vpackRelease.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/releaseBuild/azureDevOps/vpackRelease.yml b/tools/releaseBuild/azureDevOps/vpackRelease.yml index e9d1fb286cf..14368ffb8f8 100644 --- a/tools/releaseBuild/azureDevOps/vpackRelease.yml +++ b/tools/releaseBuild/azureDevOps/vpackRelease.yml @@ -45,6 +45,12 @@ stages: ReleaseTagVar: $(ReleaseTagVar) CreateJson: yes UseJson: no + + - powershell: | + if($env:RELEASETAGVAR -match '-') { + throw "Don't release a preview build without coordinating with Windows Engineering Build Tools Team" + } + displayName: Stop any preview release - powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhss"))" displayName: Set Build Name for Non-PR From 62699bd4c5244e7745d6498a84bfe2bfd6d57360 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:34:34 -0700 Subject: [PATCH 0086/1168] Fixing regression in DSC (#20268) (#20528) --- src/System.Management.Automation/engine/Utils.cs | 1 + src/System.Management.Automation/resources/ParserStrings.resx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/System.Management.Automation/engine/Utils.cs b/src/System.Management.Automation/engine/Utils.cs index 46cc6312b53..e31cf2f81ad 100644 --- a/src/System.Management.Automation/engine/Utils.cs +++ b/src/System.Management.Automation/engine/Utils.cs @@ -1424,6 +1424,7 @@ private static class EmptyReadOnlyCollectionHolder internal static class Separators { + internal static readonly char[] Backslash = new char[] { '\\' }; internal static readonly char[] Directory = new char[] { '\\', '/' }; internal static readonly char[] DirectoryOrDrive = new char[] { '\\', '/', ':' }; internal static readonly char[] SpaceOrTab = new char[] { ' ', '\t' }; diff --git a/src/System.Management.Automation/resources/ParserStrings.resx b/src/System.Management.Automation/resources/ParserStrings.resx index f59f7428995..5631525cacc 100644 --- a/src/System.Management.Automation/resources/ParserStrings.resx +++ b/src/System.Management.Automation/resources/ParserStrings.resx @@ -1304,6 +1304,9 @@ ModuleVersion : Version of module to import. If used, ModuleName must represent Conflict in using PsDscRunAsCredential for Resource {0} because it already specifies PsDscRunAsCredential value. We can only use one PsDscRunAsCredential for the composite resource. + + Unable to find DSC schema store at "{0}". Please ensure PSDesiredStateConfiguration v3 module is installed. + {0} From b49de754e37a7fffa6c6ea6ff1164786dd2bd05c Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:35:09 -0700 Subject: [PATCH 0087/1168] Fix `Get-Service` non-terminating error message to include category (#20276) (#20529) --- .../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 1d007e6dac0..7f35e88a854 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs @@ -103,7 +103,7 @@ internal void WriteNonTerminatingError( string message = StringUtil.Format(errorMessage, serviceName, displayName, - (innerException == null) ? string.Empty : innerException.Message); + (innerException == null) ? category.ToString() : innerException.Message); var exception = new ServiceCommandException(message, innerException); exception.ServiceName = serviceName; From dd1fe759d42798b2f9baa82f2eb672d12d6c7d16 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:35:40 -0700 Subject: [PATCH 0088/1168] Fix implicit remoting proxy cmdlets to act on common parameters (#20367) (#20530) --- .../commands/utility/ImplicitRemotingCommands.cs | 14 ++++++++++++-- .../CompatiblePSEditions.Module.Tests.ps1 | 11 +++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs index 1631bb18762..f92aa919c46 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs @@ -1300,13 +1300,23 @@ private ParameterMetadata RehydrateParameterMetadata(PSObject deserializedParame parameterType); } - private static bool IsProxyForCmdlet(Dictionary parameters) + private bool IsProxyForCmdlet(Dictionary parameters) { // we are not sending CmdletBinding/DefaultParameterSet over the wire anymore // we need to infer IsProxyForCmdlet from presence of all common parameters - foreach (string commonParameterName in Cmdlet.CommonParameters) + // need to exclude `ProgressAction` which may not exist for downlevel platforms + bool isDownLevelRemote = Session.Runspace is RemoteRunspace remoteRunspace + && remoteRunspace.ServerVersion is not null + && remoteRunspace.ServerVersion <= new Version(7, 3); + + foreach (string commonParameterName in CommonParameters) { + if (isDownLevelRemote && commonParameterName == "ProgressAction") + { + continue; + } + if (!parameters.ContainsKey(commonParameterName)) { return false; 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 a9c9b69b202..d4423b034b9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 @@ -1532,4 +1532,15 @@ Describe "WinCompat importing should check availablity of built-in modules" -Tag $result[4] | Should -BeExactly 'ConvertFrom-String' $result[5] | Should -BeExactly 'CFS' } + + It 'ErrorAction should be used for cmdlet' { + try { + $out = Invoke-Expression 'get-AppLockerFileInformation NoSuch.exe -ErrorAction Stop; "after"' + } + catch { + # do nothing as we expect an error, but execution should not continue + } + + $out | Should -Not -Contain 'after' + } } From 3039e2db123a53c3ad2291091bac3abeb922365f Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:36:43 -0700 Subject: [PATCH 0089/1168] Increase timeout when publishing packages to `packages.microsoft.com` (#20470) (#20539) Co-authored-by: Travis Plunk --- tools/releaseBuild/azureDevOps/releasePipeline.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/releaseBuild/azureDevOps/releasePipeline.yml b/tools/releaseBuild/azureDevOps/releasePipeline.yml index b893a8f5cf9..3e79785de4a 100644 --- a/tools/releaseBuild/azureDevOps/releasePipeline.yml +++ b/tools/releaseBuild/azureDevOps/releasePipeline.yml @@ -341,6 +341,7 @@ stages: - stage: PublishPackages displayName: Publish packages dependsOn: GitHubManualTasks + timeoutInMinutes: 120 jobs: - job: PublishNuget @@ -356,6 +357,7 @@ stages: - job: PublishPkgsMsftCom + timeoutInMinutes: 120 pool: name: PowerShell1ES demands: From 41a1d34823f8221450bf987a709f0c71f6bee004 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:40:07 -0700 Subject: [PATCH 0090/1168] Bump Microsoft.Management.Infrastructure (#20433) (#20534) --- .../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 0a11150a782..2d45cea0f7a 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -45,7 +45,7 @@ - + From 58d1b6f8f21bbdfe0ee59c9253a38260634184d6 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:40:56 -0700 Subject: [PATCH 0091/1168] Bump Microsoft.Management.Infrastructure (#20434) (#20535) --- .../System.Management.Automation.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ea8692d1411..135b0fcba39 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 @@ -8,7 +8,7 @@ 11.0 - + From bdf1cfd2b17bcbb4d2b58231939670eed0564650 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:41:28 -0700 Subject: [PATCH 0092/1168] Fix UNC path completion regression (#20419) (#20541) --- .../CommandCompletion/CompletionCompleters.cs | 21 ++++++++----------- .../TabCompletion/TabCompletion.Tests.ps1 | 5 +++++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index e2220750606..357ce126ab5 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -4629,22 +4629,19 @@ private static List GetFileSystemProviderResults( string basePath; if (!relativePaths) { - string providerName = $"{provider.ModuleName}\\{provider.Name}::"; - if (pathInfo.Path.StartsWith(providerName, StringComparison.OrdinalIgnoreCase)) + if (pathInfo.Drive is null) { - basePath = pathInfo.Path.Substring(providerName.Length); + basePath = dirInfo.FullName; } else { - providerName = $"{provider.Name}::"; - if (pathInfo.Path.StartsWith(providerName, StringComparison.OrdinalIgnoreCase)) - { - basePath = pathInfo.Path.Substring(providerName.Length); - } - else - { - basePath = pathInfo.Path; - } + int stringStartIndex = pathInfo.Drive.Root.EndsWith(provider.ItemSeparator) && pathInfo.Drive.Root.Length > 1 + ? pathInfo.Drive.Root.Length - 1 + : pathInfo.Drive.Root.Length; + + basePath = pathInfo.Drive.VolumeSeparatedByColon + ? string.Concat(pathInfo.Drive.Name, ":", dirInfo.FullName.AsSpan(stringStartIndex)) + : string.Concat(pathInfo.Drive.Name, dirInfo.FullName.AsSpan(stringStartIndex)); } basePath = basePath.EndsWith(provider.ItemSeparator) diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index 800e15ad840..613e673ceef 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -1276,6 +1276,11 @@ class InheritedClassTest : System.Attribute } } + It 'Should correct slashes in UNC path completion' -Skip:(!$IsWindows) { + $Res = TabExpansion2 -inputScript 'Get-ChildItem //localhost/c$/Windows' + $Res.CompletionMatches[0].CompletionText | Should -Be "'\\localhost\c$\Windows'" + } + It 'Should keep custom drive names when completing file paths' { $TempDriveName = "asdf" $null = New-PSDrive -Name $TempDriveName -PSProvider FileSystem -Root $HOME From e60125d3201b6748cb187fa4434d081b9c0b57cb Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:42:59 -0700 Subject: [PATCH 0093/1168] Fix alpine tar package name and do not crossgen alpine fxdependent package (#20459) (#20536) --- build.psm1 | 8 ++++---- tools/packaging/packaging.psm1 | 10 +++++----- .../Images/GenericLinuxFiles/PowerShellPackage.ps1 | 2 +- tools/releaseBuild/azureDevOps/templates/nuget.yml | 2 +- .../templates/release-ValidatePackageNames.yml | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build.psm1 b/build.psm1 index 27b0e493e4c..ec95e071bf7 100644 --- a/build.psm1 +++ b/build.psm1 @@ -273,7 +273,7 @@ function Test-IsReleaseCandidate return $false } -$optimizedFddRegex = 'fxdependent-(linux|linux-musl|win|win7|osx)-(x64|x86|arm64|arm)' +$optimizedFddRegex = 'fxdependent-(linux|win|win7|osx)-(x64|x86|arm64|arm)' function Start-PSBuild { [CmdletBinding(DefaultParameterSetName="Default")] @@ -309,7 +309,7 @@ function Start-PSBuild { # If this parameter is not provided it will get determined automatically. [ValidateSet("linux-musl-x64", "fxdependent", - "fxdependent-linux-musl-x64", + "fxdependent-noopt-linux-musl-x64", "fxdependent-linux-x64", "fxdependent-linux-arm64", "fxdependent-win-desktop", @@ -563,7 +563,7 @@ Fix steps: Write-Verbose "Building with shim" -Verbose $globalToolSrcFolder = Resolve-Path (Join-Path $Options.Top "../Microsoft.PowerShell.GlobalTool.Shim") | Select-Object -ExpandProperty Path - if ($Options.Runtime -eq 'fxdependent') { + if ($Options.Runtime -eq 'fxdependent' -or $Options.Runtime -eq 'fxdependent-noopt-linux-musl-x64') { $Arguments += "/property:SDKToUse=Microsoft.NET.Sdk" } elseif ($Options.Runtime -eq 'fxdependent-win-desktop') { $Arguments += "/property:SDKToUse=Microsoft.NET.Sdk.WindowsDesktop" @@ -900,7 +900,7 @@ function New-PSOptions { [ValidateSet("", "linux-musl-x64", "fxdependent", - "fxdependent-linux-musl-x64", + "fxdependent-noopt-linux-musl-x64", "fxdependent-linux-x64", "fxdependent-linux-arm64", "fxdependent-win-desktop", diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 30148f0d503..a6575088090 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -115,7 +115,7 @@ function Start-PSPackage { New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-arm64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-alpine-fxdependent") { - New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-musl-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } + New-PSOptions -Configuration "Release" -Runtime 'fxdependent-noopt-linux-musl-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } else { New-PSOptions -Configuration "Release" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } @@ -456,11 +456,11 @@ function Start-PSPackage { $Arguments = @{ PackageSourcePath = $Source Name = $Name - PackageNameSuffix = 'alpine-fxdependent' + PackageNameSuffix = 'musl-noopt-fxdependent' Version = $Version Force = $Force R2RVerification = [R2RVerification]@{ - R2RState = 'R2R' + R2RState = 'NoR2R' OperatingSystem = "Linux" } } @@ -594,7 +594,7 @@ function Start-PSPackage { Name = $Name Version = $Version Force = $Force - Architecture = "linux-musl-x64" + Architecture = "musl-x64" ExcludeSymbolicLinks = $true R2RVerification = [R2RVerification]@{ R2RState = 'R2R' @@ -4606,7 +4606,7 @@ function Invoke-AzDevOpsLinuxPackageBuild { Remove-Item -Path $binDir -Recurse -Force } - $buildParams['Runtime'] = 'fxdependent-linux-musl-x64' + $buildParams['Runtime'] = 'fxdependent-noopt-linux-musl-x64' $buildFolder = "${env:SYSTEM_ARTIFACTSDIRECTORY}/${amd64AlpineFxdBuildFolder}" Start-PSBuild -Clean @buildParams @releaseTagParam -Output $buildFolder -PSOptionsPath "${buildFolder}-meta/psoptions.json" # Remove symbol files, xml document files. diff --git a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 index ae04aed5ea3..2475dce7d89 100644 --- a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 @@ -59,7 +59,7 @@ function BuildPackages { $buildParams.Add("Runtime", "fxdependent") } elseif ($Alpine.IsPresent) { $projectAssetsZipName = 'linuxAlpineProjectAssetssymbols.zip' - $buildParams.Add("Runtime", 'linux-musl-x64') + $buildParams.Add("Runtime", 'musl-x64') } else { # make the artifact name unique $projectAssetsZipName = "linuxProjectAssets-$((Get-Date).Ticks)-symbols.zip" diff --git a/tools/releaseBuild/azureDevOps/templates/nuget.yml b/tools/releaseBuild/azureDevOps/templates/nuget.yml index 749956682d3..247e91013a3 100644 --- a/tools/releaseBuild/azureDevOps/templates/nuget.yml +++ b/tools/releaseBuild/azureDevOps/templates/nuget.yml @@ -111,7 +111,7 @@ jobs: - task: ExtractFiles@1 displayName: 'Extract files alpine-fxdependent' inputs: - archiveFilePatterns: '$(System.ArtifactsDirectory)/packages/powershell-*-linux-x64-alpine-fxdependent.tar.gz' + archiveFilePatterns: '$(System.ArtifactsDirectory)/packages/powershell-*-linux-x64-musl-noopt-fxdependent.tar.gz' destinationFolder: '$(alpineFxdPath)' - template: SetVersionVariables.yml diff --git a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml index a00ac4a8573..1fb5364302b 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml @@ -44,7 +44,7 @@ steps: - pwsh: | $message = @() Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -filter *.tar.gz | ForEach-Object { - if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-linux-musl)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-alpine\-fxdependent)\.(tar\.gz)') + if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-musl)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-musl\-fxdependent)\.(tar\.gz)') { $messageInstance = "$($_.Name) is not a valid package name" $message += $messageInstance From 5c1ca0f3f6accc7ff303641bf83d580dcf44d19b Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:43:22 -0700 Subject: [PATCH 0094/1168] Fix `unixmode` to handle `setuid` and `sticky` when file is not an executable (#20366) (#20537) --- .../CoreCLR/CorePsPlatform.cs | 109 ++++++++---------- .../UnixStat.Tests.ps1 | 15 ++- 2 files changed, 61 insertions(+), 63 deletions(-) diff --git a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs index 783afe62915..dc5db5f2c48 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs @@ -594,82 +594,69 @@ public class CommonStat private const char CanRead = 'r'; private const char CanWrite = 'w'; private const char CanExecute = 'x'; - - // helper for getting unix mode - private readonly Dictionary modeMap = new() - { - { StatMask.OwnerRead, CanRead }, - { StatMask.OwnerWrite, CanWrite }, - { StatMask.OwnerExecute, CanExecute }, - { StatMask.GroupRead, CanRead }, - { StatMask.GroupWrite, CanWrite }, - { StatMask.GroupExecute, CanExecute }, - { StatMask.OtherRead, CanRead }, - { StatMask.OtherWrite, CanWrite }, - { StatMask.OtherExecute, CanExecute }, - }; - - private readonly StatMask[] permissions = new StatMask[] - { - StatMask.OwnerRead, - StatMask.OwnerWrite, - StatMask.OwnerExecute, - StatMask.GroupRead, - StatMask.GroupWrite, - StatMask.GroupExecute, - StatMask.OtherRead, - StatMask.OtherWrite, - StatMask.OtherExecute - }; + private const char NoPerm = '-'; + private const char SetAndExec = 's'; + private const char SetAndNotExec = 'S'; + private const char StickyAndExec = 't'; + private const char StickyAndNotExec = 'T'; // The item type and the character representation for the first element in the stat string - private readonly Dictionary itemTypeTable = new() + private static readonly Dictionary itemTypeTable = new() { - { ItemType.BlockDevice, 'b' }, + { ItemType.BlockDevice, 'b' }, { ItemType.CharacterDevice, 'c' }, - { ItemType.Directory, 'd' }, - { ItemType.File, '-' }, - { ItemType.NamedPipe, 'p' }, - { ItemType.Socket, 's' }, - { ItemType.SymbolicLink, 'l' }, + { ItemType.Directory, 'd' }, + { ItemType.File, '-' }, + { ItemType.NamedPipe, 'p' }, + { ItemType.Socket, 's' }, + { ItemType.SymbolicLink, 'l' }, }; + // We'll create a few common mode strings here to reduce allocations and improve performance a bit. + private const string OwnerReadGroupReadOtherRead = "-r--r--r--"; + private const string OwnerReadWriteGroupReadOtherRead = "-rw-r--r--"; + private const string DirectoryOwnerFullGroupReadExecOtherReadExec = "drwxr-xr-x"; + /// Convert the mode to a string which is usable in our formatting. /// The mode converted into a Unix style string similar to the output of ls. public string GetModeString() { - int offset = 0; - char[] modeCharacters = new char[10]; - modeCharacters[offset++] = itemTypeTable[ItemType]; + // On an Ubuntu system (docker), these 3 are roughly 70% of all the permissions + if ((Mode & 0xFFF) == 292) + { + return OwnerReadGroupReadOtherRead; + } - foreach (StatMask permission in permissions) + if ((Mode & 0xFFF) == 420) { - // determine whether we are setuid, sticky, or the usual rwx. - if ((Mode & (int)permission) == (int)permission) - { - if ((permission == StatMask.OwnerExecute && IsSetUid) || (permission == StatMask.GroupExecute && IsSetGid)) - { - // Check for setuid and add 's' - modeCharacters[offset] = 's'; - } - else if (permission == StatMask.OtherExecute && IsSticky && (ItemType == ItemType.Directory)) - { - // Directories are sticky, rather than setuid - modeCharacters[offset] = 't'; - } - else - { - modeCharacters[offset] = modeMap[permission]; - } - } - else - { - modeCharacters[offset] = '-'; - } + return OwnerReadWriteGroupReadOtherRead; + } - offset++; + if (ItemType == ItemType.Directory & (Mode & 0xFFF) == 493) + { + return DirectoryOwnerFullGroupReadExecOtherReadExec; } + Span modeCharacters = stackalloc char[10]; + modeCharacters[0] = itemTypeTable[ItemType]; + bool isExecutable; + + UnixFileMode modeInfo = (UnixFileMode)Mode; + modeCharacters[1] = modeInfo.HasFlag(UnixFileMode.UserRead) ? CanRead : NoPerm; + modeCharacters[2] = modeInfo.HasFlag(UnixFileMode.UserWrite) ? CanWrite : NoPerm; + isExecutable = modeInfo.HasFlag(UnixFileMode.UserExecute); + modeCharacters[3] = modeInfo.HasFlag(UnixFileMode.SetUser) ? (isExecutable ? SetAndExec : SetAndNotExec) : (isExecutable ? CanExecute : NoPerm); + + modeCharacters[4] = modeInfo.HasFlag(UnixFileMode.GroupRead) ? CanRead : NoPerm; + modeCharacters[5] = modeInfo.HasFlag(UnixFileMode.GroupWrite) ? CanWrite : NoPerm; + isExecutable = modeInfo.HasFlag(UnixFileMode.GroupExecute); + modeCharacters[6] = modeInfo.HasFlag(UnixFileMode.SetGroup) ? (isExecutable ? SetAndExec : SetAndNotExec) : (isExecutable ? CanExecute : NoPerm); + + modeCharacters[7] = modeInfo.HasFlag(UnixFileMode.OtherRead) ? CanRead : NoPerm; + modeCharacters[8] = modeInfo.HasFlag(UnixFileMode.OtherWrite) ? CanWrite : NoPerm; + isExecutable = modeInfo.HasFlag(UnixFileMode.OtherExecute); + modeCharacters[9] = modeInfo.HasFlag(UnixFileMode.StickyBit) ? (isExecutable ? StickyAndExec : StickyAndNotExec) : (isExecutable ? CanExecute : NoPerm); + return new string(modeCharacters); } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 index b14df30e7e2..fcefb707a2e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 @@ -37,6 +37,10 @@ Describe "UnixFileSystem additions" -Tag "CI" { @{ Mode = '555'; Perm = '-r-xr-xr-x'; Item = "${testFile}" }, @{ Mode = '666'; Perm = '-rw-rw-rw-'; Item = "${testFile}" }, @{ Mode = '777'; Perm = '-rwxrwxrwx'; Item = "${testFile}" }, + @{ Mode = '4644'; Perm = '-rwSr--r--'; Item = "${testFile}" }, + @{ Mode = '1644'; Perm = '-rw-r--r-T'; Item = "${testFile}" }, + @{ Mode = '2644'; Perm = '-rw-r-Sr--'; Item = "${testFile}" }, + @{ Mode = '7644'; Perm = '-rwSr-Sr-T'; Item = "${testFile}" }, @{ Mode = '4777'; Perm = '-rwsrwxrwx'; Item = "${testFile}" }, @{ Mode = '1777'; Perm = 'drwxrwxrwt'; Item = "${testDir}" } } @@ -57,9 +61,16 @@ Describe "UnixFileSystem additions" -Tag "CI" { It "Should present filemode '' string correctly as ''" -testCase $testCase { param ($Mode, $Perm, $Item ) + # chmod can fail for some modes so be sure to handle that here. + # specifically, when setting setgid chmod can fail if the group is privileged. chmod "$Mode" "${Item}" - $i = Get-Item $Item - $i.UnixMode | Should -Be $Perm + if ($LASTEXITCODE -ne 0) { + set-itresult -skip -because "chmod '$mode' failed" + } + else { + $i = Get-Item $Item + $i.UnixMode | Should -BeExactly $Perm + } } It "Should retrieve the user name for the file" { From 3c6c8cf43b99cf48dde0f8b202a6c418d55a8ac8 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:52:51 -0700 Subject: [PATCH 0095/1168] Bump JsonSchema.Net from 5.2.5 to 5.2.6 (#20421) (#20532) --- .../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 6b1e87ae441..f7410061a63 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -35,7 +35,7 @@ - + From 178df6cae6875b3c56b76276e401958926f2a565 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:58:38 -0700 Subject: [PATCH 0096/1168] Bump xunit.runner.visualstudio from 2.5.1 to 2.5.3 (#20486) (#20542) --- 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 8e1b52c7a8c..a5ecd4e5296 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -25,7 +25,7 @@ - + From 3ea6496813c90b6eedd05d587cf5327fd2b0eba1 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 14:59:25 -0700 Subject: [PATCH 0097/1168] Bump version of `Microsoft.PowerShell.PSResourceGet` to `v1.0.0` (#20485) (#20538) Co-authored-by: alerickson <25858831+alerickson@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 a96bac9f64d..f4d5d37475b 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -13,7 +13,7 @@ - + From 9e8a5cc033f83627d5f91a74d4bd2aee6b2f82f0 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 15:03:42 -0700 Subject: [PATCH 0098/1168] Fix `Copy-Item` progress to only show completed when all files are copied (#20517) (#20544) --- .../namespaces/FileSystemProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 5704773b738..7236a6f3891 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -3569,7 +3569,7 @@ protected override void CopyItem( } CopyItemLocalOrToSession(path, destinationPath, recurse, Force, null); - if (_totalFiles > 0) + if (Stopping || _copiedFiles == _totalFiles) { _copyStopwatch.Stop(); var progress = new ProgressRecord(COPY_FILE_ACTIVITY_ID, " ", " "); From faba49e24aec565d0e75be2898d84e771d8a767f Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 15:08:01 -0700 Subject: [PATCH 0099/1168] Add SBOM for release pipeline (#20519) --- .../azureDevOps/releasePipeline.yml | 7 ++++- .../templates/release-CreateGitHubDraft.yml | 27 +++++++++++++++---- .../release-ValidatePackageNames.yml | 4 +-- .../azureDevOps/templates/vpackReleaseJob.yml | 4 +-- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/releasePipeline.yml b/tools/releaseBuild/azureDevOps/releasePipeline.yml index 3e79785de4a..b406dd0b732 100644 --- a/tools/releaseBuild/azureDevOps/releasePipeline.yml +++ b/tools/releaseBuild/azureDevOps/releasePipeline.yml @@ -29,6 +29,12 @@ resources: name: Internal-PowerShellTeam-Tools ref: main-mirror + - repository: ComplianceRepo + type: github + endpoint: ComplianceGHRepo + name: PowerShell/compliance + ref: master + variables: - name: runCodesignValidationInjection value : false @@ -341,7 +347,6 @@ stages: - stage: PublishPackages displayName: Publish packages dependsOn: GitHubManualTasks - timeoutInMinutes: 120 jobs: - job: PublishNuget diff --git a/tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml b/tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml index dc7cf126630..64c4d1b6a24 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml @@ -7,17 +7,16 @@ steps: - template: release-SetReleaseTagAndContainerName.yml - pwsh: | - Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1' + Import-module '$(BUILD.SOURCESDIRECTORY)/PowerShell/build.psm1' Install-AzCopy displayName: Install AzCopy retryCountOnTaskFailure: 2 - pwsh: | - Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1' + Import-module '$(BUILD.SOURCESDIRECTORY)/PowerShell/build.psm1' $azcopy = Find-AzCopy Write-Verbose -Verbose "Found AzCopy: $azcopy" - & $azcopy login --service-principal --application-id $(PowerShellReleaseSPN) & $azcopy cp https://$(StorageAccount).blob.core.windows.net/$(AzureVersion) $(System.ArtifactsDirectory) --recursive $packagesPath = Get-ChildItem -Path $(System.ArtifactsDirectory)\*.deb -Recurse -File | Select-Object -First 1 -ExpandProperty DirectoryName @@ -27,7 +26,7 @@ steps: displayName: Download Azure Artifacts retryCountOnTaskFailure: 2 env: - AZCOPY_SPA_CLIENT_SECRET: $(PowerShellReleaseSPNSecret) + AZCOPY_AUTO_LOGIN_TYPE: MSI - pwsh: | Get-ChildItem $(System.ArtifactsDirectory)\* -recurse | Select-Object -ExpandProperty FullName @@ -55,6 +54,24 @@ steps: Write-Verbose -Verbose -Message $fileContent displayName: Add sha256 hashes +- checkout: ComplianceRepo + +- pwsh: | + $releaseVersion = '$(ReleaseTag)' -replace '^v','' + $vstsCommandString = "vso[task.setvariable variable=ReleaseVersion]$releaseVersion" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + displayName: 'Set release version' + +- template: Sbom.yml@ComplianceRepo + parameters: + BuildDropPath: '$(PackagesRoot)' + Build_Repository_Uri: 'https://github.com/powershell/powershell.git' + displayName: PowerShell Hashes SBOM + packageName: PowerShell Artifact Hashes + packageVersion: $(ReleaseVersion) + sourceScanPath: '$(PackagesRoot)' + - pwsh: | Import-module '$(Pipeline.Workspace)/tools/Scripts/GitHubRelease.psm1' $releaseVersion = '$(ReleaseTag)' -replace '^v','' @@ -69,7 +86,7 @@ steps: $semanticVersion.Major.ToString() + "." + $semanticVersion.Minor.ToString() + ".md" } - $filePath = "$env:BUILD_SOURCESDIRECTORY/CHANGELOG/$fileName" + $filePath = "$env:BUILD_SOURCESDIRECTORY/PowerShell/CHANGELOG/$fileName" Write-Verbose -Verbose "Selected Log file: $filePath" if (-not (Test-Path $filePath)) { diff --git a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml index 1fb5364302b..44d09d45de1 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml @@ -16,13 +16,11 @@ steps: $azcopy = Find-AzCopy Write-Verbose -Verbose "Found AzCopy: $azcopy" - & $azcopy login --service-principal --application-id $(PowerShellReleaseSPN) - & $azcopy cp https://$(StorageAccount).blob.core.windows.net/$(AzureVersion)/* $(System.ArtifactsDirectory) --recursive displayName: Download Azure Artifacts env: - AZCOPY_SPA_CLIENT_SECRET: $(PowerShellReleaseSPNSecret) + AZCOPY_AUTO_LOGIN_TYPE: MSI - pwsh: | Get-ChildItem $(System.ArtifactsDirectory)\* -recurse | Select-Object -ExpandProperty Name diff --git a/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml b/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml index 61371fcfaa6..83779c75aa0 100644 --- a/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml +++ b/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml @@ -39,15 +39,13 @@ jobs: $azcopy = Find-AzCopy Write-Verbose -Verbose "Found AzCopy: $azcopy" - & $azcopy login --service-principal --application-id $(PowerShellReleaseSPN) - Write-Host "running: $azcopy cp https://$(StorageAccount).blob.core.windows.net/$(AzureVersion)/PowerShell-$(Version)-win-${{ parameters.architecture }}.zip $(System.ArtifactsDirectory)" & $azcopy cp https://$(StorageAccount).blob.core.windows.net/$(AzureVersion)/PowerShell-$(Version)-win-${{ parameters.architecture }}.zip $(System.ArtifactsDirectory) displayName: 'Download Azure Artifacts' retryCountOnTaskFailure: 2 env: - AZCOPY_SPA_CLIENT_SECRET: $(PowerShellReleaseSPNSecret) + AZCOPY_AUTO_LOGIN_TYPE: MSI - pwsh: 'Get-ChildItem $(System.ArtifactsDirectory)\* -recurse | Select-Object -ExpandProperty Name' displayName: 'Capture Artifact Listing' From dd56ad65ad33b953d0fb05580c3834ec3a523aa2 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 15:21:42 -0700 Subject: [PATCH 0100/1168] Add SBOM for release pipeline (#20519) (#20548) --- .../azureDevOps/releasePipeline.yml | 7 ++++- .../templates/release-CreateGitHubDraft.yml | 27 +++++++++++++++---- .../release-ValidatePackageNames.yml | 4 +-- .../azureDevOps/templates/vpackReleaseJob.yml | 4 +-- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/releasePipeline.yml b/tools/releaseBuild/azureDevOps/releasePipeline.yml index 3e79785de4a..b406dd0b732 100644 --- a/tools/releaseBuild/azureDevOps/releasePipeline.yml +++ b/tools/releaseBuild/azureDevOps/releasePipeline.yml @@ -29,6 +29,12 @@ resources: name: Internal-PowerShellTeam-Tools ref: main-mirror + - repository: ComplianceRepo + type: github + endpoint: ComplianceGHRepo + name: PowerShell/compliance + ref: master + variables: - name: runCodesignValidationInjection value : false @@ -341,7 +347,6 @@ stages: - stage: PublishPackages displayName: Publish packages dependsOn: GitHubManualTasks - timeoutInMinutes: 120 jobs: - job: PublishNuget diff --git a/tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml b/tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml index dc7cf126630..64c4d1b6a24 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml @@ -7,17 +7,16 @@ steps: - template: release-SetReleaseTagAndContainerName.yml - pwsh: | - Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1' + Import-module '$(BUILD.SOURCESDIRECTORY)/PowerShell/build.psm1' Install-AzCopy displayName: Install AzCopy retryCountOnTaskFailure: 2 - pwsh: | - Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1' + Import-module '$(BUILD.SOURCESDIRECTORY)/PowerShell/build.psm1' $azcopy = Find-AzCopy Write-Verbose -Verbose "Found AzCopy: $azcopy" - & $azcopy login --service-principal --application-id $(PowerShellReleaseSPN) & $azcopy cp https://$(StorageAccount).blob.core.windows.net/$(AzureVersion) $(System.ArtifactsDirectory) --recursive $packagesPath = Get-ChildItem -Path $(System.ArtifactsDirectory)\*.deb -Recurse -File | Select-Object -First 1 -ExpandProperty DirectoryName @@ -27,7 +26,7 @@ steps: displayName: Download Azure Artifacts retryCountOnTaskFailure: 2 env: - AZCOPY_SPA_CLIENT_SECRET: $(PowerShellReleaseSPNSecret) + AZCOPY_AUTO_LOGIN_TYPE: MSI - pwsh: | Get-ChildItem $(System.ArtifactsDirectory)\* -recurse | Select-Object -ExpandProperty FullName @@ -55,6 +54,24 @@ steps: Write-Verbose -Verbose -Message $fileContent displayName: Add sha256 hashes +- checkout: ComplianceRepo + +- pwsh: | + $releaseVersion = '$(ReleaseTag)' -replace '^v','' + $vstsCommandString = "vso[task.setvariable variable=ReleaseVersion]$releaseVersion" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + displayName: 'Set release version' + +- template: Sbom.yml@ComplianceRepo + parameters: + BuildDropPath: '$(PackagesRoot)' + Build_Repository_Uri: 'https://github.com/powershell/powershell.git' + displayName: PowerShell Hashes SBOM + packageName: PowerShell Artifact Hashes + packageVersion: $(ReleaseVersion) + sourceScanPath: '$(PackagesRoot)' + - pwsh: | Import-module '$(Pipeline.Workspace)/tools/Scripts/GitHubRelease.psm1' $releaseVersion = '$(ReleaseTag)' -replace '^v','' @@ -69,7 +86,7 @@ steps: $semanticVersion.Major.ToString() + "." + $semanticVersion.Minor.ToString() + ".md" } - $filePath = "$env:BUILD_SOURCESDIRECTORY/CHANGELOG/$fileName" + $filePath = "$env:BUILD_SOURCESDIRECTORY/PowerShell/CHANGELOG/$fileName" Write-Verbose -Verbose "Selected Log file: $filePath" if (-not (Test-Path $filePath)) { diff --git a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml index 1fb5364302b..44d09d45de1 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml @@ -16,13 +16,11 @@ steps: $azcopy = Find-AzCopy Write-Verbose -Verbose "Found AzCopy: $azcopy" - & $azcopy login --service-principal --application-id $(PowerShellReleaseSPN) - & $azcopy cp https://$(StorageAccount).blob.core.windows.net/$(AzureVersion)/* $(System.ArtifactsDirectory) --recursive displayName: Download Azure Artifacts env: - AZCOPY_SPA_CLIENT_SECRET: $(PowerShellReleaseSPNSecret) + AZCOPY_AUTO_LOGIN_TYPE: MSI - pwsh: | Get-ChildItem $(System.ArtifactsDirectory)\* -recurse | Select-Object -ExpandProperty Name diff --git a/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml b/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml index 61371fcfaa6..83779c75aa0 100644 --- a/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml +++ b/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml @@ -39,15 +39,13 @@ jobs: $azcopy = Find-AzCopy Write-Verbose -Verbose "Found AzCopy: $azcopy" - & $azcopy login --service-principal --application-id $(PowerShellReleaseSPN) - Write-Host "running: $azcopy cp https://$(StorageAccount).blob.core.windows.net/$(AzureVersion)/PowerShell-$(Version)-win-${{ parameters.architecture }}.zip $(System.ArtifactsDirectory)" & $azcopy cp https://$(StorageAccount).blob.core.windows.net/$(AzureVersion)/PowerShell-$(Version)-win-${{ parameters.architecture }}.zip $(System.ArtifactsDirectory) displayName: 'Download Azure Artifacts' retryCountOnTaskFailure: 2 env: - AZCOPY_SPA_CLIENT_SECRET: $(PowerShellReleaseSPNSecret) + AZCOPY_AUTO_LOGIN_TYPE: MSI - pwsh: 'Get-ChildItem $(System.ArtifactsDirectory)\* -recurse | Select-Object -ExpandProperty Name' displayName: 'Capture Artifact Listing' From a7d7526f6ea59ad2a2b2c20e7a45e4be896fcf8d Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 15:34:22 -0700 Subject: [PATCH 0101/1168] Add telemetry to check for specific tags when importing a module (#20371) (#20540) --- .../engine/Modules/ImportModuleCommand.cs | 10 ++-- .../utils/Telemetry.cs | 59 +++++++++++++++++-- 2 files changed, 58 insertions(+), 11 deletions(-) diff --git a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs index dbbbf7286ae..15e8bfe6a9a 100644 --- a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs @@ -619,7 +619,7 @@ private PSModuleInfo ImportModule_LocallyViaName_WithTelemetry(ImportModuleOptio // avoid double reporting for WinCompat modules that go through CommandDiscovery\AutoloadSpecifiedModule if (!foundModule.IsWindowsPowerShellCompatModule) { - ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, foundModule.Name, foundModule.Version?.ToString()); + ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, foundModule); #if LEGACYTELEMETRY TelemetryAPI.ReportModuleLoad(foundModule); #endif @@ -893,7 +893,7 @@ private PSModuleInfo ImportModule_LocallyViaFQName(ImportModuleOptions importMod if (foundModule != null) { - ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, foundModule.Name, foundModule.Version?.ToString()); + ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, foundModule); SetModuleBaseForEngineModules(foundModule.Name, this.Context); } @@ -935,7 +935,7 @@ private IList ImportModule_RemotelyViaPsrpSession( // Send telemetry on the imported modules foreach (PSModuleInfo moduleInfo in remotelyImportedModules) { - ApplicationInsightsTelemetry.SendModuleTelemetryMetric(usingWinCompat ? TelemetryType.WinCompatModuleLoad : TelemetryType.ModuleLoad, moduleInfo.Name, moduleInfo.Version?.ToString()); + ApplicationInsightsTelemetry.SendModuleTelemetryMetric(usingWinCompat ? TelemetryType.WinCompatModuleLoad : TelemetryType.ModuleLoad, moduleInfo); } return remotelyImportedModules; @@ -1866,7 +1866,7 @@ protected override void ProcessRecord() // of doing Get-Module -list foreach (PSModuleInfo module in ModuleInfo) { - ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, module.Name, module.Version?.ToString()); + ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, module); RemoteDiscoveryHelper.DispatchModuleInfoProcessing( module, localAction: () => @@ -1926,7 +1926,7 @@ protected override void ProcessRecord() ImportModule_RemotelyViaPsrpSession(importModuleOptions, null, FullyQualifiedName, this.PSSession); foreach (ModuleSpecification modulespec in FullyQualifiedName) { - ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, modulespec.Name, modulespec.Version?.ToString()); + ApplicationInsightsTelemetry.SendModuleTelemetryMetric(TelemetryType.ModuleLoad, modulespec.Name); } } else if (this.ParameterSetName.Equals(ParameterSet_ViaWinCompat, StringComparison.OrdinalIgnoreCase) diff --git a/src/System.Management.Automation/utils/Telemetry.cs b/src/System.Management.Automation/utils/Telemetry.cs index a1c3d324b5d..5588cb103a7 100644 --- a/src/System.Management.Automation/utils/Telemetry.cs +++ b/src/System.Management.Automation/utils/Telemetry.cs @@ -5,11 +5,14 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Management.Automation; using System.Runtime.InteropServices; +using System.Security.AccessControl; using System.Threading; using Microsoft.ApplicationInsights; +using Microsoft.ApplicationInsights.Metrics; using Microsoft.ApplicationInsights.Channel; using Microsoft.ApplicationInsights.Extensibility; using Microsoft.ApplicationInsights.Extensibility.Implementation; @@ -124,6 +127,9 @@ public static class ApplicationInsightsTelemetry // Use '0.0' as the string for an anonymous module version private const string AnonymousVersion = "0.0"; + // Use 'n/a' as the string when there's no tag to report + private const string NoTag = "n/a"; + // the telemetry failure string private const string _telemetryFailure = "TELEMETRY_FAILURE"; @@ -140,9 +146,11 @@ public static class ApplicationInsightsTelemetry 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. + /// We send telemetry only a known set of modules and tags. + /// If it's not in the list (initialized in the static constructor), then we report anonymous + /// or don't report anything (in the case of tags). private static readonly HashSet s_knownModules; + private static readonly HashSet s_knownModuleTags; /// Gets a value indicating whether telemetry can be sent. public static bool CanSendTelemetry { get; private set; } = false; @@ -601,6 +609,12 @@ static ApplicationInsightsTelemetry() "xWindowsUpdate", }; + // use a hashset when looking for module names, it should be quicker than a string comparison + s_knownModuleTags = new HashSet(StringComparer.OrdinalIgnoreCase) + { + "CrescendoBuilt", + }; + s_uniqueUserIdentifier = GetUniqueIdentifier().ToString(); } } @@ -671,6 +685,41 @@ private static bool GetEnvironmentVariableAsBool(string name, bool defaultValue) return defaultValue; } + /// + /// Send module load telemetry as a metric. + /// For modules we send the module name (if allowed), and the version. + /// Some modules (CIM) will continue use the string alternative method. + /// + /// The type of telemetry that we'll be sending. + /// The module to report. If it is not allowed, then it is set to 'anonymous'. + internal static void SendModuleTelemetryMetric(TelemetryType telemetryType, PSModuleInfo moduleInfo) + { + if (!CanSendTelemetry) + { + return; + } + + // Package up the module name, version, and known tags as a metric. + // Note that the allowed tags will be a comma separated list which will need to + // be handled in the telemetry query. + try + { + string allowedModuleName = GetModuleName(moduleInfo.Name); + string allowedModuleVersion = allowedModuleName == Anonymous ? AnonymousVersion : moduleInfo.Version?.ToString(); + var allowedModuleTags = moduleInfo.Tags.Where(t => s_knownModuleTags.Contains(t)).Distinct(); + string allowedModuleTagString = allowedModuleTags.Any() ? string.Join(',', allowedModuleTags) : NoTag; + + s_telemetryClient. + GetMetric(new MetricIdentifier(string.Empty, telemetryType.ToString(), "uuid", "SessionId", "ModuleName", "Version", "Tag")). + TrackValue(metricValue: 1.0, s_uniqueUserIdentifier, s_sessionId, allowedModuleName, allowedModuleVersion, allowedModuleTagString); + } + catch + { + // Ignore errors. + } + + } + /// /// Send module load telemetry as a metric. /// For modules we send the module name (if allowed), and the version. @@ -678,8 +727,7 @@ private static bool GetEnvironmentVariableAsBool(string name, bool defaultValue) /// /// The type of telemetry that we'll be sending. /// The module name to report. If it is not allowed, then it is set to 'anonymous'. - /// The module version to report. The default value is the anonymous version '0.0.0.0'. - internal static void SendModuleTelemetryMetric(TelemetryType telemetryType, string moduleName, string moduleVersion = AnonymousVersion) + internal static void SendModuleTelemetryMetric(TelemetryType telemetryType, string moduleName) { if (!CanSendTelemetry) { @@ -689,8 +737,7 @@ internal static void SendModuleTelemetryMetric(TelemetryType telemetryType, stri try { string allowedModuleName = GetModuleName(moduleName); - string allowedModuleVersion = allowedModuleName == Anonymous ? AnonymousVersion : moduleVersion; - s_telemetryClient.GetMetric(telemetryType.ToString(), "uuid", "SessionId", "ModuleName", "Version").TrackValue(metricValue: 1.0, s_uniqueUserIdentifier, s_sessionId, allowedModuleName, allowedModuleVersion); + s_telemetryClient.GetMetric(telemetryType.ToString(), "uuid", "SessionId", "ModuleName", "Version").TrackValue(metricValue: 1.0, s_uniqueUserIdentifier, s_sessionId, allowedModuleName, AnonymousVersion); } catch { From ab75f9d6a54681fa5febde4c30929baf75131726 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 15:44:01 -0700 Subject: [PATCH 0102/1168] Bump Microsoft.Management.Infrastructure (#20512) (#20545) --- .../System.Management.Automation.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 135b0fcba39..4b756e722aa 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 @@ -8,7 +8,7 @@ 11.0 - + From 2135b1c93305483c08c9dba1176e37d370cb8863 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 16:06:31 -0700 Subject: [PATCH 0103/1168] Bump to .NET 8 RC2 (#20510) (#20543) --- DotnetRuntimeMetadata.json | 8 +++---- global.json | 2 +- ...oft.PowerShell.Commands.Diagnostics.csproj | 2 +- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 ++-- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 22 +++++++++---------- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 16 +++++++------- .../BenchmarkDotNet.Extensions.csproj | 4 ++-- .../ResultsComparer/ResultsComparer.csproj | 2 +- ...soft.PowerShell.NamedPipeConnection.csproj | 2 +- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 ++-- 14 files changed, 37 insertions(+), 37 deletions(-) diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json index 464ca8a6291..5b6ac60b802 100644 --- a/DotnetRuntimeMetadata.json +++ b/DotnetRuntimeMetadata.json @@ -1,13 +1,13 @@ { "sdk": { - "channel": "8.0.1xx-rc1", + "channel": "8.0.1xx-rc2", "quality": "daily", "qualityFallback": "preview", - "packageVersionPattern": "8.0.0-rc.1", + "packageVersionPattern": "8.0.0-rc.2", "sdkImageVersion": "8.0.100", - "nextChannel": "8.0.1xx-preview4", + "nextChannel": "8.0.1xx-rc2", "azureFeed": "", - "sdkImageOverride": "" + "sdkImageOverride": "8.0.100-rc.2.23502.2" }, "internalfeed": { "url": "" diff --git a/global.json b/global.json index adc56119682..3ecc5db745d 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.100-rc.1.23463.5" + "version": "8.0.100-rc.2.23502.2" } } diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj index e3fc9bd3cf3..1e7f70bc8f8 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj @@ -8,7 +8,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 4952214240a..0d6c585478d 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 f7410061a63..31b1082aa9d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -33,8 +33,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 5922c52e366..3c00ae295b8 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 3082c48bc23..85588f8b535 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -19,22 +19,22 @@ - - - + + + - - - - - - + + + + + + - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index 4ab85c79597..084ba8e2ffe 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 2d45cea0f7a..fe97fc5e560 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -34,16 +34,16 @@ - - - - + + + + - + - - - + + + diff --git a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj index 0956c4122c7..2a398dad179 100644 --- a/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj +++ b/test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj b/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj index 0fc80386919..a8b48dde151 100644 --- a/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj +++ b/test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj @@ -9,7 +9,7 @@ - + diff --git a/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj b/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj index 6dcec1060f1..b53f1921a73 100644 --- a/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj +++ b/test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj @@ -15,6 +15,6 @@ - + diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index 561dac20d1f..396c34ab46a 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 89e69a428fa..5e7fc468c65 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + From ce4cc672099b1dae51d8d9e9c06c43d9e389d8d0 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 16:06:56 -0700 Subject: [PATCH 0104/1168] Bump Microsoft.Management.Infrastructure (#20511) (#20547) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../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 fe97fc5e560..1568b76ee0e 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -45,7 +45,7 @@ - + From 240bd1f2cc7e86c50531312df43db2d47f29ce87 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 18:56:02 -0700 Subject: [PATCH 0105/1168] Fix `Test-Connection` due to .NET 8 changes (#20369) (#20531) --- .../commands/management/TestConnectionCommand.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs index 1f497e5dd2c..1370a56ea96 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs @@ -56,7 +56,7 @@ public class TestConnectionCommand : PSCmdlet, IDisposable #region Private Fields - private static byte[]? s_DefaultSendBuffer; + private static readonly byte[] s_DefaultSendBuffer = Array.Empty(); private readonly CancellationTokenSource _dnsLookupCancel = new(); @@ -484,7 +484,10 @@ private void ProcessTraceroute(string targetNameOrAddress) reply.Status == IPStatus.Success ? reply.RoundtripTime : timer.ElapsedMilliseconds, - buffer.Length, + + // If we use the empty buffer, then .NET actually uses a 32 byte buffer so we want to show + // as the result object the actual buffer size used instead of 0. + buffer.Length == 0 ? DefaultSendBufferSize : buffer.Length, pingNum: i); WriteObject(new TraceStatus( currentHop, @@ -707,7 +710,7 @@ private void ProcessPing(string targetNameOrAddress) resolvedTargetName, reply, reply.RoundtripTime, - buffer.Length, + buffer.Length == 0 ? DefaultSendBufferSize : buffer.Length, pingNum: (uint)i)); } @@ -862,7 +865,7 @@ private IPHostEntry GetCancellableHostEntry(string targetNameOrAddress) // Creates and fills a send buffer. This follows the ping.exe and CoreFX model. private static byte[] GetSendBuffer(int bufferSize) { - if (bufferSize == DefaultSendBufferSize && s_DefaultSendBuffer != null) + if (bufferSize == DefaultSendBufferSize) { return s_DefaultSendBuffer; } @@ -874,11 +877,6 @@ private static byte[] GetSendBuffer(int bufferSize) sendBuffer[i] = (byte)((int)'a' + i % 23); } - if (bufferSize == DefaultSendBufferSize && s_DefaultSendBuffer == null) - { - s_DefaultSendBuffer = sendBuffer; - } - return sendBuffer; } From b60d5659e7107f87c2abcbf3b553cec5a45e542c Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 18:56:29 -0700 Subject: [PATCH 0106/1168] Bump PSReadLine from 2.2.6 to 2.3.4 (#20305) (#20533) --- src/Modules/PSGalleryModules.csproj | 2 +- test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 | 4 ++-- tools/packaging/boms/windows.json | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Modules/PSGalleryModules.csproj b/src/Modules/PSGalleryModules.csproj index f4d5d37475b..80a1b7e2022 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -15,7 +15,7 @@ - + diff --git a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 index 6e5924d9c55..975f4f82da3 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 -Match '^2.2.\d$' + $module.Version | Should -Match '^2.3.\d$' } 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 -Match '^2.2.\d$' + $module.Version | Should -Match '^2.3.\d$' $module.Path | Should -Be (Join-Path -Path $PSHOME -ChildPath "Modules/PSReadLine/PSReadLine.psd1") } diff --git a/tools/packaging/boms/windows.json b/tools/packaging/boms/windows.json index f1a9bec1ed5..4ec63b872c2 100644 --- a/tools/packaging/boms/windows.json +++ b/tools/packaging/boms/windows.json @@ -827,6 +827,10 @@ "Pattern": "Modules/Microsoft.PowerShell.PSResourceGet/Microsoft.PowerShell.PSResourceGet.psd1", "FileType": "NonProduct" }, + { + "Pattern": "Modules/Microsoft.PowerShell.PSResourceGet/Microsoft.PowerShell.PSResourceGet.psm1", + "FileType": "NonProduct" + }, { "Pattern": "Modules/Microsoft.PowerShell.PSResourceGet/Notice.txt", "FileType": "NonProduct" @@ -900,7 +904,7 @@ "FileType": "NonProduct" }, { - "Pattern": "Modules/Microsoft.PowerShell.PSResourceGet/Microsoft.PowerShell.PSResourceGet.psm1", + "Pattern": "Modules\\PSReadLine\\_manifest\\spdx_2.2\\manifest.cat", "FileType": "NonProduct" }, { From 0baa5b4b713fc84113669a9ede58575a2368ff60 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 19 Oct 2023 21:53:56 -0700 Subject: [PATCH 0107/1168] Only registry App Path for release package (#20478) (#20549) Co-authored-by: Heath Stewart --- assets/wix/Product.wxs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/wix/Product.wxs b/assets/wix/Product.wxs index b4f9a5f90bd..6f34a33849e 100644 --- a/assets/wix/Product.wxs +++ b/assets/wix/Product.wxs @@ -151,7 +151,9 @@ - + + + @@ -209,13 +211,15 @@ - + + + DISABLE_TELEMETRY From 5b05198d4f8e864023e71b9953ca052209234e0d Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 20 Oct 2023 10:29:53 -0700 Subject: [PATCH 0108/1168] Fix package version for .NET nuget packages (#20551) --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj | 2 +- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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 31b1082aa9d..a23b657f61e 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 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 85588f8b535..749e916eab5 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -34,7 +34,7 @@ - + diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index 396c34ab46a..ed5011fdc19 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 5e7fc468c65..3d9d5a4eda6 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,7 +7,7 @@ - + From a550c2ce0ef743411df58740b24fe64c775008ab Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 20 Oct 2023 12:34:17 -0700 Subject: [PATCH 0109/1168] Fix package version for .NET nuget packages (#20551) (#20552) --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj | 2 +- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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 31b1082aa9d..a23b657f61e 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 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 85588f8b535..749e916eab5 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -34,7 +34,7 @@ - + diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index 396c34ab46a..ed5011fdc19 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 5e7fc468c65..3d9d5a4eda6 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,7 +7,7 @@ - + From ef8559e2fb8cad710c6d61f7b8ec70a5fa59dc96 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 20 Oct 2023 15:56:55 -0700 Subject: [PATCH 0110/1168] Update CGManifest for release --- tools/cgmanifest.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index 741ae0cbf52..8b92f890ec2 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { @@ -55,7 +56,7 @@ "Type": "nuget", "Nuget": { "Name": "JsonSchema.Net", - "Version": "5.2.5" + "Version": "5.2.6" } }, "DevelopmentDependency": false @@ -575,7 +576,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Private.ServiceModel", - "Version": "4.10.2" + "Version": "4.10.3" } }, "DevelopmentDependency": false @@ -695,7 +696,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ServiceModel.Duplex", - "Version": "4.10.2" + "Version": "4.10.3" } }, "DevelopmentDependency": false @@ -705,7 +706,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ServiceModel.Http", - "Version": "4.10.2" + "Version": "4.10.3" } }, "DevelopmentDependency": false @@ -715,7 +716,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ServiceModel.NetTcp", - "Version": "4.10.2" + "Version": "4.10.3" } }, "DevelopmentDependency": false @@ -725,7 +726,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ServiceModel.Primitives", - "Version": "4.10.2" + "Version": "4.10.3" } }, "DevelopmentDependency": false @@ -735,7 +736,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ServiceModel.Security", - "Version": "4.10.2" + "Version": "4.10.3" } }, "DevelopmentDependency": false @@ -830,6 +831,5 @@ }, "DevelopmentDependency": false } - ], - "$schema": "https://json.schemastore.org/component-detection-manifest.json" + ] } From 7198f70eb303c5ae9e6f4593a679a44e20e25d00 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 23 Oct 2023 18:31:08 +0000 Subject: [PATCH 0111/1168] Merged PR 28110: Update ThirdPartyNotices.txt file Update ThirdPartyNotices.txt file --- ThirdPartyNotices.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index cfda2226963..b7d54550aff 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -238,7 +238,7 @@ SOFTWARE. --------------------------------------------------------- -JsonSchema.Net 5.2.5 - MIT +JsonSchema.Net 5.2.6 - MIT @@ -2989,7 +2989,7 @@ SOFTWARE. --------------------------------------------------------- -System.Private.ServiceModel 4.10.2 - MIT +System.Private.ServiceModel 4.10.3 - MIT (c) Microsoft Corporation @@ -3854,7 +3854,7 @@ SOFTWARE. --------------------------------------------------------- -System.ServiceModel.Duplex 4.10.2 - MIT +System.ServiceModel.Duplex 4.10.3 - MIT (c) Microsoft Corporation @@ -3890,7 +3890,7 @@ SOFTWARE. --------------------------------------------------------- -System.ServiceModel.Http 4.10.2 - MIT +System.ServiceModel.Http 4.10.3 - MIT (c) Microsoft Corporation @@ -3926,7 +3926,7 @@ SOFTWARE. --------------------------------------------------------- -System.ServiceModel.NetTcp 4.10.2 - MIT +System.ServiceModel.NetTcp 4.10.3 - MIT (c) Microsoft Corporation @@ -3962,7 +3962,7 @@ SOFTWARE. --------------------------------------------------------- -System.ServiceModel.Primitives 4.10.2 - MIT +System.ServiceModel.Primitives 4.10.3 - MIT (c) Microsoft Corporation @@ -3998,7 +3998,7 @@ SOFTWARE. --------------------------------------------------------- -System.ServiceModel.Security 4.10.2 - MIT +System.ServiceModel.Security 4.10.3 - MIT (c) Microsoft Corporation From 1012b45276e25adc46302043dc2bce8fa4759e21 Mon Sep 17 00:00:00 2001 From: Ankita Sikdar <115947852+AnkitaSikdar005@users.noreply.github.com> Date: Tue, 24 Oct 2023 03:52:13 +0530 Subject: [PATCH 0112/1168] Update ADOPTERS.md (#20555) --- ADOPTERS.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ADOPTERS.md b/ADOPTERS.md index 79ed1ff81c7..186b99dd093 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -15,8 +15,8 @@ This is a list of adopters using PowerShell in production or in their products ( * [Azure Cloud Shell](https://shell.azure.com/) provides a battery-included browser-based PowerShell environment used by Azure administrators to manage their environment. It includes up-to-date PowerShell modules for `Azure`, `AzureAD`, `Exchange`, `Teams`, and many more. More information about Azure Cloud Shell is available at [Azure Cloud Shell Overview.](https://learn.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. +* [Azure Functions - PowerShell](https://github.com/Azure/azure-functions-powershell-worker) is a serverless compute service to execute PowerShell scripts on 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 for managing function apps and service plans in the cloud. For more information about Functions, please visit [functions overview](https://learn.microsoft.com/azure/azure-functions/functions-overview). * [PowerShell Universal](https://ironmansoftware.com/powershell-universal) is a cross-platform web framework for PowerShell. It provides the ability to create robust, interactive sites, REST APIs, and Electron-based desktop apps with PowerShell script. @@ -31,9 +31,9 @@ This is a list of adopters using PowerShell in production or in their products ( * [Azure Resource Manager Deployment Scripts](https://learn.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. It is 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://learn.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. +* [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 are used by customers of GitHub Actions include PowerShell out of the box. * [GitHub Actions Python builds](https://github.com/actions/python-versions) GitHub Actions uses PowerShell to automate building Python from source for its runners. * [Microsoft HoloLens](https://www.microsoft.com/hololens) makes extensive use of PowerShell 7+ throughout the development cycle to automate tasks such as firmware assembly and automated testing. * [Power BI](https://powerbi.microsoft.com/) provides PowerShell users a set of cmdlets in [MicrosoftPowerBIMgmt](https://learn.microsoft.com/powershell/power-bi) module to manage and automate the Power BI service. - This is in addition to Power BI leveraging PowerShell internally for various engineering systems and infrastructure for its service. + This is in addition to Power BI leveraging PowerShell, internally for various engineering systems and infrastructure for its service. * [Windows 10 IoT Core](https://learn.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 e8763649ca78ad5b384fabbc62b5b14ed31128ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:22:33 -0700 Subject: [PATCH 0113/1168] Bump Microsoft.Security.Extensions from 1.2.0 to 1.3.0 (#20556) --- .../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 1568b76ee0e..79ce3314af3 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -48,7 +48,7 @@ - + From f60f7e24ba663ef4a9157851ea0e85b181d7c154 Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:23:35 -0700 Subject: [PATCH 0114/1168] Update the cgmanifest (#20523) --- tools/cgmanifest.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index 0b2f8d4c279..8b92f890ec2 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { @@ -575,7 +576,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Private.ServiceModel", - "Version": "4.10.2" + "Version": "4.10.3" } }, "DevelopmentDependency": false @@ -695,7 +696,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ServiceModel.Duplex", - "Version": "4.10.2" + "Version": "4.10.3" } }, "DevelopmentDependency": false @@ -705,7 +706,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ServiceModel.Http", - "Version": "4.10.2" + "Version": "4.10.3" } }, "DevelopmentDependency": false @@ -715,7 +716,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ServiceModel.NetTcp", - "Version": "4.10.2" + "Version": "4.10.3" } }, "DevelopmentDependency": false @@ -725,7 +726,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ServiceModel.Primitives", - "Version": "4.10.2" + "Version": "4.10.3" } }, "DevelopmentDependency": false @@ -735,7 +736,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ServiceModel.Security", - "Version": "4.10.2" + "Version": "4.10.3" } }, "DevelopmentDependency": false @@ -830,6 +831,5 @@ }, "DevelopmentDependency": false } - ], - "$schema": "https://json.schemastore.org/component-detection-manifest.json" + ] } From 7c8b1c819d1b717859a912ea07711a6750964d37 Mon Sep 17 00:00:00 2001 From: Surav Shrestha <98219089+suravshresth@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:11:21 +0545 Subject: [PATCH 0115/1168] Fix link in `docs/community/governance.md` (#20515) --- 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 dcad933fb36..8cc989d2497 100644 --- a/docs/community/governance.md +++ b/docs/community/governance.md @@ -147,4 +147,4 @@ See our [Pull Request Process][pull-request-process] [docs-contributing]: https://github.com/PowerShell/PowerShell-Docs/blob/staging/CONTRIBUTING.md [maintainers]: ../maintainers/README.md [wg]: ./working-group.md -[wg-defintions]: ./working-group-definitions.md +[wg-definitions]: ./working-group-definitions.md From 1727de38af5982fb0ff020e2228e8bbd56948854 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 23 Oct 2023 22:51:14 +0000 Subject: [PATCH 0116/1168] Merged PR 28127: Update agent pool to allow MSI to Azure blob Update agent pool to allow MSI to Azure blob --- tools/releaseBuild/azureDevOps/releasePipeline.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/releasePipeline.yml b/tools/releaseBuild/azureDevOps/releasePipeline.yml index b406dd0b732..fb6b8d5d956 100644 --- a/tools/releaseBuild/azureDevOps/releasePipeline.yml +++ b/tools/releaseBuild/azureDevOps/releasePipeline.yml @@ -147,8 +147,9 @@ stages: - job: ValidatePkgNames displayName: Validate Package Names pool: - # testing - vmImage: windows-latest + name: PowerShell1ES + demands: + - ImageOverride -equals PSMMS2019-Secure variables: - group: 'Azure Blob variable group' steps: From 30883500129f8db93c46f1f2467e006082378413 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 24 Oct 2023 02:32:26 +0000 Subject: [PATCH 0117/1168] Merged PR 28126: Update changelog for v7.4.0-rc.1 Update changelog for v7.4.0-rc.1 --- CHANGELOG/preview.md | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/CHANGELOG/preview.md b/CHANGELOG/preview.md index 11027a45126..d8ba3d0958e 100644 --- a/CHANGELOG/preview.md +++ b/CHANGELOG/preview.md @@ -1,5 +1,51 @@ # Current preview release +## [7.4.0-rc.1] - 2023-10-24 + +### General Cmdlet Updates and Fixes + +- Fix `Test-Connection` due to .NET 8 changes (#20369) (#20531) +- Add telemetry to check for specific tags when importing a module (#20371) (#20540) +- Fix `Copy-Item` progress to only show completed when all files are copied (#20517) (#20544) +- Fix `unixmode` to handle `setuid` and `sticky` when file is not an executable (#20366) (#20537) +- Fix UNC path completion regression (#20419) (#20541) +- Fix implicit remoting proxy cmdlets to act on common parameters (#20367) (#20530) +- Fix `Get-Service` non-terminating error message to include category (#20276) (#20529) +- Fixing regression in DSC (#20268) (#20528) + +### Build and Packaging Improvements + +
+ + + +

We thank the following contributors!

+ +
+ +
    +
  • Update ThirdPartyNotices.txt file (Internal 28110)
  • +
  • Update CGManifest for release
  • +
  • Fix package version for .NET nuget packages (#20551) (#20552)
  • +
  • Only registry App Path for release package (#20478) (#20549)
  • +
  • Bump PSReadLine from 2.2.6 to 2.3.4 (#20305) (#20533)
  • +
  • Bump Microsoft.Management.Infrastructure (#20511) (#20512) (#20433) (#20434) (#20534) (#20535) (#20545) (#20547)
  • +
  • Bump to .NET 8 RC2 (#20510) (#20543)
  • + +
  • Add SBOM for release pipeline (#20519) (#20548)
  • +
  • Bump version of Microsoft.PowerShell.PSResourceGet to v1.0.0 (#20485) (#20538)
  • +
  • Bump xunit.runner.visualstudio from 2.5.1 to 2.5.3 (#20486) (#20542)
  • +
  • Bump JsonSchema.Net from 5.2.5 to 5.2.6 (#20421) (#20532)
  • +
  • Fix alpine tar package name and do not crossgen alpine fxdependent package (#20459) (#20536)
  • +
  • Increase timeout when publishing packages to packages.microsoft.com (#20470) (#20539)
  • +
  • Block any preview vPack release (#20243) (#20526)
  • +
  • Add surrogate file for compliance scanning (#20423)
  • +
+ +
+ +[7.4.0-rc.1]: https://github.com/PowerShell/PowerShell/compare/v7.4.0-preview.6...v7.4.0-rc.1 + ## [7.4.0-preview.6] - 2023-09-28 ### General Cmdlet Updates and Fixes From 1dc05eaac0560deff8cac0492e7b129e83b17492 Mon Sep 17 00:00:00 2001 From: Armaan Mcleod Date: Tue, 24 Oct 2023 14:32:25 +1100 Subject: [PATCH 0118/1168] Add argument completer for `Set-StrictMode -Version` (#20554) --- .../engine/InternalCommands.cs | 37 +++++++++++++++++++ .../TabCompletion/TabCompletion.Tests.ps1 | 24 ++++++++++++ 2 files changed, 61 insertions(+) diff --git a/src/System.Management.Automation/engine/InternalCommands.cs b/src/System.Management.Automation/engine/InternalCommands.cs index 10739b18960..86502861bfa 100644 --- a/src/System.Management.Automation/engine/InternalCommands.cs +++ b/src/System.Management.Automation/engine/InternalCommands.cs @@ -2686,6 +2686,7 @@ protected override void Validate(object arguments, EngineIntrinsics engineIntrin /// Gets or sets strict mode in the current scope. ///
[Parameter(ParameterSetName = "Version", Mandatory = true)] + [ArgumentCompleter(typeof(StrictModeVersionArgumentCompleter))] [ArgumentToPSVersionTransformation] [ValidateVersion] [Alias("v")] @@ -2717,6 +2718,42 @@ protected override void EndProcessing() Context.EngineSessionState.CurrentScope.StrictModeVersion = _version; } } + + /// + /// Provides argument completion for StrictMode Version parameter. + /// + public class StrictModeVersionArgumentCompleter : IArgumentCompleter + { + private static readonly string[] s_strictModeVersions = new string[] { "Latest", "3.0", "2.0", "1.0" }; + + /// + /// Returns completion results for version parameter. + /// + /// The command name. + /// The parameter name. + /// The word to complete. + /// The command AST. + /// The fake bound parameters. + /// List of Completion Results. + public IEnumerable CompleteArgument( + string commandName, + string parameterName, + string wordToComplete, + CommandAst commandAst, + IDictionary fakeBoundParameters) + { + var strictModeVersionPattern = WildcardPattern.Get(wordToComplete + "*", WildcardOptions.IgnoreCase); + + foreach (string version in s_strictModeVersions) + { + if (strictModeVersionPattern.IsMatch(version)) + { + yield return new CompletionResult(version); + } + } + } + } + #endregion Set-StrictMode #endregion Built-in cmdlets that are used by or require direct access to the engine. diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index 369b5994dcb..4d4aea1f0aa 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -744,6 +744,30 @@ ConstructorTestClass(int i, bool b) $res.CompletionMatches[0].CompletionText | Should -BeExactly '$TestVar1' } + Context 'StrictMode Version parameter completion' { + BeforeAll { + $allStrictModeVersions = '1.0 2.0 3.0 Latest' + $versionOne = '1.0' + $versionTwo = '2.0' + $versionThree = '3.0' + $latestVersion = 'Latest' + } + + It "Should complete Version for ''" -TestCases @( + @{ TextInput = "Set-StrictMode -Version "; ExpectedVersions = $allStrictModeVersions } + @{ TextInput = "Set-StrictMode -Version 1"; ExpectedVersions = $versionOne } + @{ TextInput = "Set-StrictMode -Version 2"; ExpectedVersions = $versionTwo } + @{ TextInput = "Set-StrictMode -Version 3"; ExpectedVersions = $versionThree } + @{ TextInput = "Set-StrictMode -Version Lat"; ExpectedVersions = $latestVersion } + @{ TextInput = "Set-StrictMode -Version NonExistentVersion"; ExpectedVersions = '' } + ) { + param($TextInput, $ExpectedVersions) + $res = TabExpansion2 -inputScript $TextInput -cursorColumn $TextInput.Length + $completionText = $res.CompletionMatches.CompletionText | Sort-Object + $completionText -join ' ' | Should -BeExactly $ExpectedVersions + } + } + Context "Format cmdlet's View paramter completion" { BeforeAll { $viewDefinition = @' From b5db0ad1e469d2a4324180351679431d747dd43f Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 24 Oct 2023 20:47:05 +0000 Subject: [PATCH 0119/1168] Merged PR 28142: Update tar.gz package expected pattern for Alpine no-opt package Update tar.gz package expected pattern for Alpine no-opt package --- .../azureDevOps/templates/release-ValidatePackageNames.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml index 44d09d45de1..2a0a19e4ca9 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml @@ -42,7 +42,7 @@ steps: - pwsh: | $message = @() Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -filter *.tar.gz | ForEach-Object { - if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-musl)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-musl\-fxdependent)\.(tar\.gz)') + if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-musl-noopt\-fxdependent)\.(tar\.gz)') { $messageInstance = "$($_.Name) is not a valid package name" $message += $messageInstance From 0e2c97e8437f894740cecc0eee093191076385f7 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 24 Oct 2023 21:22:55 +0000 Subject: [PATCH 0120/1168] Merged PR 28143: Update tar.gz package expected pattern for Alpine opt package Update tar.gz package expected pattern for Alpine opt package --- .../azureDevOps/templates/release-ValidatePackageNames.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml index 2a0a19e4ca9..8e41fbc4a55 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml @@ -42,7 +42,7 @@ steps: - pwsh: | $message = @() Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -filter *.tar.gz | ForEach-Object { - if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-musl-noopt\-fxdependent)\.(tar\.gz)') + if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-musl)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-musl-noopt\-fxdependent)\.(tar\.gz)') { $messageInstance = "$($_.Name) is not a valid package name" $message += $messageInstance From f1e0723f7dd960a1a770c8ae925d15db4d632fd2 Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Tue, 24 Oct 2023 16:20:57 -0700 Subject: [PATCH 0121/1168] Update the cgmanifest (#20560) --- tools/cgmanifest.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index 8b92f890ec2..47486606cab 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -1,5 +1,4 @@ { - "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { @@ -186,7 +185,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.Security.Extensions", - "Version": "1.2.0" + "Version": "1.3.0" } }, "DevelopmentDependency": false @@ -831,5 +830,6 @@ }, "DevelopmentDependency": false } - ] + ], + "$schema": "https://json.schemastore.org/component-detection-manifest.json" } From 6e57ea745c693cd70d715ea723fde7fbbf0bcc63 Mon Sep 17 00:00:00 2001 From: Ankita Sikdar <115947852+AnkitaSikdar005@users.noreply.github.com> Date: Wed, 25 Oct 2023 05:07:28 +0530 Subject: [PATCH 0122/1168] Update `README.md` to improve readability (#20553) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 281b9ed3353..fb9e2481b5d 100644 --- a/README.md +++ b/README.md @@ -142,11 +142,11 @@ For more information on how and why we built this dashboard, check out this [blo ## Discussions -[GitHub Discussions](https://docs.github.com/discussions/quickstart) is a feature to enable fluid and open discussions within the community +[GitHub Discussions](https://docs.github.com/discussions/quickstart) is a feature to enable free and open discussions within the community for topics that are not related to code, unlike issues. -This is an experiment we are trying in our repositories to see if it helps move discussions out of issues so that issues remain actionable by the team or members of the community. -There should be no expectation that PowerShell team members are regular participants in the discussions. +This is an experiment we are trying in our repositories, to see if it helps move discussions out of issues so that issues remain actionable by the team or members of the community. +There should be no expectation that PowerShell team members are regular participants in these discussions. Individual PowerShell team members may choose to participate in discussions, but the expectation is that community members help drive discussions so that team members can focus on issues. @@ -208,7 +208,7 @@ For more information, see [working with the PowerShell repository](https://githu ## Developing and Contributing -Please see the [Contribution Guide][] for how to develop and contribute. +Please look into the [Contribution Guide][] to know how to develop and contribute. If you are developing .NET Core C# applications targeting PowerShell Core, [check out our FAQ][] to learn more about the PowerShell SDK NuGet package. Also, make sure to check out our [PowerShell-RFC repository](https://github.com/powershell/powershell-rfc) for request-for-comments (RFC) documents to submit and give comments on proposed and future designs. From 1649f2fab8e4fa303d2e563a14ded1d93d942db9 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 24 Oct 2023 17:18:26 -0700 Subject: [PATCH 0123/1168] Update `README.md` and `metadata.json` for the v7.4.0-rc.1 release (#20558) --- README.md | 28 ++++++++++++++-------------- tools/metadata.json | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index fb9e2481b5d..5d297c7f690 100644 --- a/README.md +++ b/README.md @@ -93,20 +93,20 @@ You can also download the PowerShell binary archives for Windows, macOS, and Lin [rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-linux-arm64.tar.gz [rl-snap]: https://snapcraft.io/powershell -[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/PowerShell-7.4.0-preview.6-win-x64.msi -[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/PowerShell-7.4.0-preview.6-win-x86.msi -[pv-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-preview_7.4.0-preview.6-1.deb_amd64.deb -[pv-rpm]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-preview-7.4.0_preview.6-1.rh.x86_64.rpm -[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-osx-x64.pkg -[pv-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-osx-arm64.pkg -[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/PowerShell-7.4.0-preview.6-win-arm64.zip -[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/PowerShell-7.4.0-preview.6-win-x86.zip -[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/PowerShell-7.4.0-preview.6-win-x64.zip -[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-osx-x64.tar.gz -[pv-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-osx-arm64.tar.gz -[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-linux-x64.tar.gz -[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-linux-arm32.tar.gz -[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.6/powershell-7.4.0-preview.6-linux-arm64.tar.gz +[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/PowerShell-7.4.0-rc.1-win-x64.msi +[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/PowerShell-7.4.0-rc.1-win-x86.msi +[pv-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-preview_7.4.0-rc.1-1.deb_amd64.deb +[pv-rpm]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-preview-7.4.0_rc.1-1.rh.x86_64.rpm +[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-osx-x64.pkg +[pv-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-osx-arm64.pkg +[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/PowerShell-7.4.0-rc.1-win-arm64.zip +[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/PowerShell-7.4.0-rc.1-win-x86.zip +[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/PowerShell-7.4.0-rc.1-win-x64.zip +[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-osx-x64.tar.gz +[pv-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-osx-arm64.tar.gz +[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-linux-x64.tar.gz +[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-linux-arm32.tar.gz +[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-linux-arm64.tar.gz [pv-snap]: https://snapcraft.io/powershell-preview [in-windows]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows diff --git a/tools/metadata.json b/tools/metadata.json index 5b20967dca0..29d013fa2b7 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,6 +1,6 @@ { "StableReleaseTag": "v7.3.8", - "PreviewReleaseTag": "v7.4.0-preview.6", + "PreviewReleaseTag": "v7.4.0-rc.1", "ServicingReleaseTag": "v7.0.13", "ReleaseTag": "v7.3.8", "LTSReleaseTag" : ["v7.2.15"], From a2853800fa68737d6406cdd257d820f7a0aadcce Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:31:55 -0700 Subject: [PATCH 0124/1168] Update to the latest NOTICES file (#20576) --- ThirdPartyNotices.txt | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 29e923a74e6..6f273af2f21 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -259,6 +259,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI Microsoft.ApplicationInsights 2.21.0 - MIT +(c) Microsoft Corporation MIT License @@ -2945,20 +2946,22 @@ SOFTWARE. System.Numerics.Vectors 4.5.0 - MIT -(c) Microsoft Corporation. +(c) 2023 GitHub, Inc. +(c) Microsoft Corporation +Copyright (c) .NET Foundation Copyright (c) 2011, Google Inc. -(c) 1997-2005 Sean Eron Anderson. +(c) 1997-2005 Sean Eron Anderson Copyright (c) 1991-2017 Unicode, Inc. +Copyright (c) 2015 The Chromium Authors Portions (c) International Organization -Copyright (c) 2015 The Chromium Authors. Copyright (c) 2004-2006 Intel Corporation Copyright (c) .NET Foundation Contributors Copyright (c) .NET Foundation and Contributors Copyright (c) 2011 Novell, Inc (http://www.novell.com) Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) -Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. -Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers THIS WORK IS PROVIDED AS +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors +Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers The MIT License (MIT) @@ -2989,7 +2992,7 @@ SOFTWARE. --------------------------------------------------------- -System.Private.ServiceModel 4.10.2 - MIT +System.Private.ServiceModel 4.10.3 - MIT (c) Microsoft Corporation @@ -3854,7 +3857,7 @@ SOFTWARE. --------------------------------------------------------- -System.ServiceModel.Duplex 4.10.2 - MIT +System.ServiceModel.Duplex 4.10.3 - MIT (c) Microsoft Corporation @@ -3890,7 +3893,7 @@ SOFTWARE. --------------------------------------------------------- -System.ServiceModel.Http 4.10.2 - MIT +System.ServiceModel.Http 4.10.3 - MIT (c) Microsoft Corporation @@ -3926,7 +3929,7 @@ SOFTWARE. --------------------------------------------------------- -System.ServiceModel.NetTcp 4.10.2 - MIT +System.ServiceModel.NetTcp 4.10.3 - MIT (c) Microsoft Corporation @@ -3962,7 +3965,7 @@ SOFTWARE. --------------------------------------------------------- -System.ServiceModel.Primitives 4.10.2 - MIT +System.ServiceModel.Primitives 4.10.3 - MIT (c) Microsoft Corporation @@ -3998,7 +4001,7 @@ SOFTWARE. --------------------------------------------------------- -System.ServiceModel.Security 4.10.2 - MIT +System.ServiceModel.Security 4.10.3 - MIT (c) Microsoft Corporation From e946b560a343179041219a0a7f42d6a15f7f4d29 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 26 Oct 2023 12:15:11 -0700 Subject: [PATCH 0125/1168] Update README and metadata.json for servicing releases (#20582) --- README.md | 54 ++++++++++++++++++++++----------------------- tools/metadata.json | 6 ++--- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 5d297c7f690..084e7e2d651 100644 --- a/README.md +++ b/README.md @@ -64,33 +64,33 @@ You can also download the PowerShell binary archives for Windows, macOS, and Lin | Windows (ARM) | [64-bit][rl-winarm64] (preview) | [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-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.15/PowerShell-7.2.15-win-x86.msi -[lts-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.15/PowerShell-7.2.15-win-x64.msi -[lts-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.15/powershell-lts_7.2.15-1.deb_amd64.deb -[lts-rh]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.15/powershell-lts-7.2.15-1.rh.x86_64.rpm -[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.15/powershell-lts-7.2.15-osx-x64.pkg -[lts-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.15/powershell-lts-7.2.15-osx-arm64.pkg - -[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/PowerShell-7.3.8-win-x64.msi -[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/PowerShell-7.3.8-win-x86.msi -[rl-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell_7.3.8-1.deb_amd64.deb -[rl-ubuntu22]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell_7.3.8-1.deb_amd64.deb -[rl-ubuntu20]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell_7.3.8-1.deb_amd64.deb -[rl-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell_7.3.8-1.deb_amd64.deb -[rl-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell_7.3.8-1.deb_amd64.deb -[rl-debian11]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell_7.3.8-1.deb_amd64.deb -[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-1.rh.x86_64.rpm -[rl-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-1.rh.x86_64.rpm -[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-osx-x64.pkg -[rl-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-osx-arm64.pkg -[rl-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/PowerShell-7.3.8-win-arm64.zip -[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/PowerShell-7.3.8-win-x86.zip -[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/PowerShell-7.3.8-win-x64.zip -[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-osx-x64.tar.gz -[rl-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-osx-arm64.tar.gz -[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-linux-x64.tar.gz -[rl-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-linux-arm32.tar.gz -[rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-linux-arm64.tar.gz +[lts-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.16/PowerShell-7.2.16-win-x86.msi +[lts-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.16/PowerShell-7.2.16-win-x64.msi +[lts-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.16/powershell-lts_7.2.16-1.deb_amd64.deb +[lts-rh]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.16/powershell-lts-7.2.16-1.rh.x86_64.rpm +[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.16/powershell-lts-7.2.16-osx-x64.pkg +[lts-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.16/powershell-lts-7.2.16-osx-arm64.pkg + +[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/PowerShell-7.3.9-win-x64.msi +[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/PowerShell-7.3.9-win-x86.msi +[rl-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell_7.3.9-1.deb_amd64.deb +[rl-ubuntu22]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell_7.3.9-1.deb_amd64.deb +[rl-ubuntu20]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell_7.3.9-1.deb_amd64.deb +[rl-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell_7.3.9-1.deb_amd64.deb +[rl-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell_7.3.9-1.deb_amd64.deb +[rl-debian11]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell_7.3.9-1.deb_amd64.deb +[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-1.rh.x86_64.rpm +[rl-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-1.rh.x86_64.rpm +[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-osx-x64.pkg +[rl-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-osx-arm64.pkg +[rl-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/PowerShell-7.3.9-win-arm64.zip +[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/PowerShell-7.3.9-win-x86.zip +[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/PowerShell-7.3.9-win-x64.zip +[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-osx-x64.tar.gz +[rl-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-osx-arm64.tar.gz +[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-linux-x64.tar.gz +[rl-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-linux-arm32.tar.gz +[rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-linux-arm64.tar.gz [rl-snap]: https://snapcraft.io/powershell [pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/PowerShell-7.4.0-rc.1-win-x64.msi diff --git a/tools/metadata.json b/tools/metadata.json index 29d013fa2b7..997a7db753d 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,9 +1,9 @@ { - "StableReleaseTag": "v7.3.8", + "StableReleaseTag": "v7.3.9", "PreviewReleaseTag": "v7.4.0-rc.1", "ServicingReleaseTag": "v7.0.13", - "ReleaseTag": "v7.3.8", - "LTSReleaseTag" : ["v7.2.15"], + "ReleaseTag": "v7.3.9", + "LTSReleaseTag" : ["v7.2.16"], "NextReleaseTag": "v7.4.0-preview.7", "LTSRelease": { "Latest": false, "Package": false }, "StableRelease": { "Latest": false, "Package": false } From edfc3bd992cbc1102b2aa943d9732d14bc9257de Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 31 Oct 2023 10:06:36 -0700 Subject: [PATCH 0126/1168] Fix `Group-Object` so output uses current culture (#20608) --- .../commands/utility/Group-Object.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 51f8f0a6011..0f0a9951967 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Group-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Group-Object.cs @@ -153,7 +153,7 @@ private static string BuildName(List propValues) foreach (object item in propertyValueItems) { - sb.Append(CultureInfo.InvariantCulture, $"{item}, "); + sb.AppendFormat(CultureInfo.CurrentCulture, $"{item}, "); } sb = sb.Length > length ? sb.Remove(sb.Length - 2, 2) : sb; @@ -161,7 +161,7 @@ private static string BuildName(List propValues) } else { - sb.Append(CultureInfo.InvariantCulture, $"{propValuePropertyValue}, "); + sb.AppendFormat(CultureInfo.CurrentCulture, $"{propValuePropertyValue}, "); } } } From 687383bcc14af4594b2e2cd8f8f987a8f11657e6 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 31 Oct 2023 16:06:15 -0700 Subject: [PATCH 0127/1168] Block getting help from network locations in restricted remoting sessions (#20593) --- .../commandHelpers/ShowCommandHelper.cs | 31 ------- .../engine/Utils.cs | 20 ++++- .../help/HelpCommands.cs | 13 ++- .../namespaces/FileSystemProvider.cs | 2 +- .../resources/HelpErrors.resx | 3 + .../Help/HelpSystem.OnlineHelp.Tests.ps1 | 17 ++++ .../Remoting/RemoteSession.Basic.Tests.ps1 | 30 ++++++- .../Modules/HelpersCommon/HelpersCommon.psd1 | 1 + .../Modules/HelpersCommon/HelpersCommon.psm1 | 84 +++++++++++++++++++ 9 files changed, 166 insertions(+), 35 deletions(-) diff --git a/src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs b/src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs index 13dfe839b9d..32c68e961c6 100644 --- a/src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs +++ b/src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs @@ -489,37 +489,6 @@ private static string GetSerializedCommandScript() @"Remove-Item -Path 'function:\PSGetSerializedShowCommandInfo' -Force"); } - /// - /// Gets the command to be run to in order to import a module and refresh the command data. - /// - /// Module we want to import. - /// Boolean flag determining whether Show-Command is queried in the local or remote runspace scenario. - /// Boolean flag to indicate that it is the second attempt to query Show-Command data. - /// The command to be run to in order to import a module and refresh the command data. - internal static string GetImportModuleCommand(string module, bool isRemoteRunspace = false, bool isFirstChance = true) - { - string scriptBase = "Import-Module " + ShowCommandHelper.SingleQuote(module); - - if (isRemoteRunspace) - { - if (isFirstChance) - { - scriptBase += ";@(Get-Command " + ShowCommandHelper.CommandTypeSegment + @" -ShowCommandInfo )"; - } - else - { - scriptBase += GetSerializedCommandScript(); - } - } - else - { - scriptBase += ";@(Get-Command " + ShowCommandHelper.CommandTypeSegment + ")"; - } - - scriptBase += ShowCommandHelper.GetGetModuleSuffix(); - return scriptBase; - } - /// /// Gets the command to be run in order to show help for a command. /// diff --git a/src/System.Management.Automation/engine/Utils.cs b/src/System.Management.Automation/engine/Utils.cs index e31cf2f81ad..1ad23a40cc6 100644 --- a/src/System.Management.Automation/engine/Utils.cs +++ b/src/System.Management.Automation/engine/Utils.cs @@ -1256,7 +1256,8 @@ internal static bool PathIsDevicePath(string path) #if UNIX return false; #else - return path.StartsWith(@"\\.\") || path.StartsWith(@"\\?\"); + // device paths can be network paths, we would need windows to parse it. + return path.StartsWith(@"\\.\") || path.StartsWith(@"\\?\") || path.StartsWith(@"\\;"); #endif } @@ -1523,6 +1524,23 @@ internal static string DisplayHumanReadableFileSize(long bytes) _ => $"0 Bytes", }; } + + /// + /// Returns true if the current session is restricted (JEA or similar sessions) + /// + /// ExecutionContext. + /// True if the session is restricted. + internal static bool IsSessionRestricted(ExecutionContext context) + { + CmdletInfo cmdletInfo = context.SessionState.InvokeCommand.GetCmdlet("Microsoft.PowerShell.Core\\Import-Module"); + // if import-module is visible, then the session is not restricted, + // because the user can load arbitrary code. + if (cmdletInfo != null && cmdletInfo.Visibility == SessionStateEntryVisibility.Public) + { + return false; + } + return true; + } } } diff --git a/src/System.Management.Automation/help/HelpCommands.cs b/src/System.Management.Automation/help/HelpCommands.cs index af79758dcb3..1b451637a5d 100644 --- a/src/System.Management.Automation/help/HelpCommands.cs +++ b/src/System.Management.Automation/help/HelpCommands.cs @@ -255,6 +255,17 @@ protected override void BeginProcessing() /// protected override void ProcessRecord() { +#if !UNIX + string fileSystemPath = SessionState.Path.GetUnresolvedProviderPathFromPSPath(this.Name); + string normalizedName = FileSystemProvider.NormalizePath(fileSystemPath); + // In a restricted session, do not allow help on network paths or device paths, because device paths can be used to bypass the restrictions. + if (Utils.IsSessionRestricted(this.Context) && (FileSystemProvider.PathIsNetworkPath(normalizedName) || Utils.PathIsDevicePath(normalizedName))) { + Exception e = new ArgumentException(HelpErrors.NoNetworkCommands, "Name"); + ErrorRecord errorRecord = new ErrorRecord(e, "CommandNameNotAllowed", ErrorCategory.InvalidArgument, null); + this.ThrowTerminatingError(errorRecord); + } +#endif + HelpSystem helpSystem = this.Context.HelpSystem; try { @@ -504,7 +515,7 @@ private void GetAndWriteParameterInfo(HelpInfo helpInfo) } /// - /// Validates input parameters. + /// Validates input parameters. /// /// Category specified by the user. /// diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 7236a6f3891..9337b466805 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -105,7 +105,7 @@ public FileSystemProvider() /// /// The path with all / normalized to \ /// - private static string NormalizePath(string path) + internal static string NormalizePath(string path) { return GetCorrectCasedPath(path.Replace(StringLiterals.AlternatePathSeparator, StringLiterals.DefaultPathSeparator)); } diff --git a/src/System.Management.Automation/resources/HelpErrors.resx b/src/System.Management.Automation/resources/HelpErrors.resx index 851e457cf27..27634de2995 100644 --- a/src/System.Management.Automation/resources/HelpErrors.resx +++ b/src/System.Management.Automation/resources/HelpErrors.resx @@ -187,4 +187,7 @@ To update these Help topics, start PowerShell by using the "Run as Administrator ForwardHelpTargetName cannot refer to the function itself. + + Cannot get help from a network location when in a restricted session. + diff --git a/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 b/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 index b56effc8626..3e06c51f6cd 100644 --- a/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 +++ b/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 @@ -1,6 +1,8 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. +Import-Module HelpersCommon + Describe 'Online help tests for PowerShell Cmdlets' -Tags "Feature" { # The csv files (V2Cmdlets.csv and V3Cmdlets.csv) contain a list of cmdlets and expected HelpURIs. @@ -61,3 +63,18 @@ Describe 'Get-Help -Online is not supported on Nano Server and IoT' -Tags "CI" { { Get-Help Get-Help -Online } | Should -Throw -ErrorId "InvalidOperation,Microsoft.PowerShell.Commands.GetHelpCommand" } } + +Describe 'Get-Help should throw on network paths' -Tags "CI" { + BeforeAll { + $script:skipTest = -not $IsWindows + } + + It "Get-Help should throw not on " -Skip:$skipTest -TestCases (Get-HelpNetworkTestCases -PositiveCases) { + param( + $Command, + $ExpectedError + ) + + { Get-Help -Name $Command } | Should -Not -Throw + } +} diff --git a/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 b/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 index 8efe61de357..43f92cef295 100644 --- a/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 +++ b/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 @@ -106,7 +106,6 @@ Describe "JEA session Transcript script test" -Tag @("Feature", 'RequireAdminOnW Unregister-PSSessionConfiguration -Name JEA -Force -ErrorAction SilentlyContinue } } - } Describe "JEA session Get-Help test" -Tag @("CI", 'RequireAdminOnWindows') { @@ -155,6 +154,34 @@ Describe "JEA session Get-Help test" -Tag @("CI", 'RequireAdminOnWindows') { Remove-Item $RoleCapDirectory -Recurse -Force -ErrorAction SilentlyContinue } } + + It "Get-Help should throw on " -TestCases (Get-HelpNetworkTestCases) { + param( + $Command, + $ExpectedError + ) + + [string] $RoleCapDirectory = (New-Item -Path "$TestDrive\RoleCapability" -ItemType Directory -Force).FullName + [string] $PSSessionConfigFile = "$RoleCapDirectory\TestConfig.pssc" + $configurationName = 'RestrictedWithNoGetHelpProxy' + try + { + New-PSSessionConfigurationFile -Path $PSSessionConfigFile ` + -SessionType Empty ` + -LanguageMode NoLanguage ` + -ModulesToImport 'Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.Core' ` + -VisibleCmdlets 'Get-command', 'measure-object', 'select-object', 'enter-pssession', 'get-formatdata', 'out-default', 'out-file', 'exit-pssession', 'get-help' + Register-PSSessionConfiguration -Name $configurationName -Path $PSSessionConfigFile -Force -ErrorAction SilentlyContinue + $scriptBlock = [scriptblock]::Create("Get-Help -Name $Command") + {Invoke-Command -ConfigurationName $configurationName -ComputerName localhost -ScriptBlock $scriptBlock -ErrorAction Stop} | + Should -Throw -ErrorId $ExpectedError + } + finally + { + Unregister-PSSessionConfiguration -Name $configurationName -Force -ErrorAction SilentlyContinue + Remove-Item $RoleCapDirectory -Recurse -Force -ErrorAction SilentlyContinue + } + } } Describe "Remoting loopback tests" -Tags @('CI', 'RequireAdminOnWindows') { @@ -358,6 +385,7 @@ Describe "Remoting loopback tests" -Tags @('CI', 'RequireAdminOnWindows') { $session = New-RemoteSession -ConfigurationName $endPoint try { $result = Invoke-Command -Session $session -ScriptBlock { $Host.Version } + Write-Verbose "host version: $result" -Verbose $result | Should -Be $PSVersionTable.PSVersion } finally { diff --git a/test/tools/Modules/HelpersCommon/HelpersCommon.psd1 b/test/tools/Modules/HelpersCommon/HelpersCommon.psd1 index 897d41c251b..dd7cd7a52aa 100644 --- a/test/tools/Modules/HelpersCommon/HelpersCommon.psd1 +++ b/test/tools/Modules/HelpersCommon/HelpersCommon.psd1 @@ -48,6 +48,7 @@ FunctionsToExport = @( 'Test-PSDefaultParameterValue' 'Push-DefaultParameterValueStack' 'Pop-DefaultParameterValueStack' + 'Get-HelpNetworkTestCases' ) CmdletsToExport= @() diff --git a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 index aefd2893a21..50d6a2e668b 100644 --- a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 +++ b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 @@ -533,3 +533,87 @@ function Pop-DefaultParameterValueStack { return $false } } + +function Get-HelpNetworkTestCases +{ + param( + [switch] + $PositiveCases + ) + # .NET doesn't consider these path rooted and we won't go to the network: + # \\? + # \\. + # \?? + + # Command discovery does not follow symlinks to network locations for module qualified paths + $networkBlockedError = "CommandNameNotAllowed,Microsoft.PowerShell.Commands.GetHelpCommand" + $scriptBlockedError = "ScriptsNotAllowed" + + $formats = @( + '//{0}/share/{1}' + '\\{0}\share\{1}' + '//{0}\share/{1}' + 'Microsoft.PowerShell.Core\filesystem:://{0}/share/{1}' + ) + + if (!$PositiveCases) { + $formats += 'filesystem:://{0}/share/{1}' + } + + $moduleQualifiedCommand = 'test.dll\fakecommand' + $lanManFormat = @( + '//;LanmanRedirector/{0}/share/{1}' + ) + + $hosts = @( + 'fakehost' + 'fakehost.pstest' + ) + + $commands = @( + 'test.ps1' + 'test.dll' + $moduleQualifiedCommand + ) + + $variants = @() + $cases = @() + foreach($command in $commands) { + $hostName = $hosts[0] + $format = $formats[0] + $cases += @{ + Command = $format -f $hostName, $command + ExpectedError = $networkBlockedError + } + } + + foreach($hostName in $hosts) { + # chose the format with backslashes(\) to match the host with blackslashes + $format = $formats[1] + $command = $commands[0] + $cases += @{ + Command = $format -f $hostName, $command + ExpectedError = $networkBlockedError + } + } + foreach($format in $formats) { + $hostName = $hosts[0] + $command = $commands[0] + $cases += @{ + Command = $format -f $hostName, $command + ExpectedError = $networkBlockedError + } + } + + foreach($format in $lanManFormat) { + $hostName = $hosts[0] + $command = $moduleQualifiedCommand + $cases += @{ + Command = $format -f $hostName, $command + ExpectedError = $scriptBlockedError + } + } + + return $cases | Sort-Object -Property ExpectedError, Command -Unique +} + From 13ad6c2cfa913f178eeb148d7c983208b0685734 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 1 Nov 2023 11:21:45 -0700 Subject: [PATCH 0128/1168] Bump `Microsoft.PowerShell.Native` to `v7.4.0` (#20617) --- .../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 79ce3314af3..3b97e58c9ee 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -46,7 +46,7 @@ - +
From d3c91d0e6325cfcb0632eb9dc1e6a577fd062359 Mon Sep 17 00:00:00 2001 From: Patrick Meinecke Date: Wed, 1 Nov 2023 15:42:28 -0400 Subject: [PATCH 0129/1168] Added a missing `ConfigureAwait(false)` call (#20606) --- .../utility/WebCmdlet/StreamHelper.cs | 4 +-- .../WebCmdlets.Tests.ps1 | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) 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 d03debf3fc0..52ff515b0b2 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs @@ -265,7 +265,7 @@ internal static async Task ReadAsync(this Stream stream, Memory buffe { if (readTimeout == Timeout.InfiniteTimeSpan) { - return await stream.ReadAsync(buffer, cancellationToken); + return await stream.ReadAsync(buffer, cancellationToken).ConfigureAwait(false); } using var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); @@ -292,7 +292,7 @@ internal static async Task CopyToAsync(this Stream source, Stream destination, T if (perReadTimeout == Timeout.InfiniteTimeSpan) { // No timeout - use fast path - await source.CopyToAsync(destination, cancellationToken); + await source.CopyToAsync(destination, cancellationToken).ConfigureAwait(false); return; } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index c9de4236960..bb283b57951 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -4600,3 +4600,34 @@ Describe 'Invoke-WebRequest and Invoke-RestMethod support OperationTimeoutSecond RunWithNetworkTimeout -Command Invoke-RestMethod -Uri $uri -OperationTimeoutSeconds 2 -WillTimeout -Arguments '-SkipCertificateCheck' } } + + +Describe "Invoke-RestMethod should run in the default synchronization context (threadpool)" -Tag "CI" { + BeforeAll { + $oldProgress = $ProgressPreference + $ProgressPreference = 'SilentlyContinue' + $WebListener = Start-WebListener + } + + AfterAll { + $ProgressPreference = $oldProgress + } + + It "Invoke-RestMethod works after constructing a WindowsForm object" -Skip:(!$IsWindows) { + $env:URI_TO_TEST = Get-WebListenerUrl -Test 'Get' + $irmResult = $null + try { + $pwsh = Join-Path $PSHOME "pwsh" + $irmResult = & $pwsh -NoProfile { + Add-Type -AssemblyName System.Windows.Forms + $null = New-Object System.Windows.Forms.Form + Invoke-RestMethod $env:URI_TO_TEST + } + } finally { + $env:URI_TO_TEST = $null + } + + # Simply making it this far is good enough to ensure we didn't hit a deadlock + $irmResult | Should -Not -BeNullOrEmpty + } +} From 27e048ce1ebc95abd7472835be5df0823f469a6e Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 6 Nov 2023 13:45:14 -0800 Subject: [PATCH 0130/1168] Bump Microsoft.Management.Infrastructure to v3.0.0 (#20642) --- .../System.Management.Automation.csproj | 2 +- .../System.Management.Automation.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 3b97e58c9ee..6a81d5053b8 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -45,7 +45,7 @@ - + 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 4b756e722aa..910a5ae576b 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 @@ -8,7 +8,7 @@ 11.0 - + From c8afc18404087ced8f58625966e9bf9ca179155e Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 6 Nov 2023 16:02:45 -0800 Subject: [PATCH 0131/1168] Fix setting of variable to consume internal SDK source (#20644) --- build.psm1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index ec95e071bf7..a53a13db908 100644 --- a/build.psm1 +++ b/build.psm1 @@ -19,7 +19,8 @@ $script:Options = $null $dotnetMetadata = Get-Content $PSScriptRoot/DotnetRuntimeMetadata.json | ConvertFrom-Json $dotnetCLIChannel = $dotnetMetadata.Sdk.Channel $dotnetCLIQuality = $dotnetMetadata.Sdk.Quality -$dotnetAzureFeed = if (-not $env:__DOTNET_RUNTIME_FEED ) { $dotnetMetadata.Sdk.azureFeed } +# __DOTNET_RUNTIME_FEED and __DOTNET_RUNTIME_FEED_KEY are private variables used in release builds +$dotnetAzureFeed = if (-not $env:__DOTNET_RUNTIME_FEED ) { $dotnetMetadata.Sdk.azureFeed } else { $env:__DOTNET_RUNTIME_FEED } $dotnetAzureFeedSecret = $env:__DOTNET_RUNTIME_FEED_KEY $dotnetSDKVersionOveride = $dotnetMetadata.Sdk.sdkImageOverride $dotnetCLIRequiredVersion = $(Get-Content $PSScriptRoot/global.json | ConvertFrom-Json).Sdk.Version From 504b6e0e6be5498421ccf01b1ae087f2cde7bcca Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Tue, 7 Nov 2023 12:57:56 +0900 Subject: [PATCH 0132/1168] Fix typo in Reset-PWSHSystemPath.ps1 (#20632) occurances -> occurrences --- tools/windows/Reset-PWSHSystemPath.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/windows/Reset-PWSHSystemPath.ps1 b/tools/windows/Reset-PWSHSystemPath.ps1 index 4b98e714525..6ee74d0624f 100644 --- a/tools/windows/Reset-PWSHSystemPath.ps1 +++ b/tools/windows/Reset-PWSHSystemPath.ps1 @@ -58,7 +58,7 @@ ForEach ($PathScopeItem in $PathScope) $pathstoremove = @([Environment]::GetEnvironmentVariable("PATH","$PathScopeItem").split(';') | Where-Object { $_ -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 + #If we are not removing all occurrences of PowerShell paths, then remove the highest sorted path from the filter $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)" From f9abea29599f490510242cec08e71e0cfa65c12c Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:48:22 -0800 Subject: [PATCH 0133/1168] Update the cgmanifest (#20627) --- tools/cgmanifest.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index 902eb0e2776..eae3f77df33 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -1,5 +1,4 @@ { - "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { @@ -136,7 +135,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.Management.Infrastructure.Runtime.Unix", - "Version": "2.0.0" + "Version": "3.0.0" } }, "DevelopmentDependency": false @@ -146,7 +145,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.Management.Infrastructure.Runtime.Win", - "Version": "2.0.0" + "Version": "3.0.0" } }, "DevelopmentDependency": true @@ -156,7 +155,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.Management.Infrastructure", - "Version": "2.0.0" + "Version": "3.0.0" } }, "DevelopmentDependency": false @@ -176,7 +175,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.PowerShell.Native", - "Version": "7.3.2" + "Version": "7.4.0" } }, "DevelopmentDependency": false @@ -831,5 +830,6 @@ }, "DevelopmentDependency": false } - ] + ], + "$schema": "https://json.schemastore.org/component-detection-manifest.json" } From c7dfd4692ac078f4348514d9e4d89ef698d88b85 Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:48:54 -0800 Subject: [PATCH 0134/1168] Update to the latest NOTICES file (#20590) --- ThirdPartyNotices.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 6f273af2f21..41d8275fc5b 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -464,9 +464,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.Security.Extensions 1.2.0 - MIT +Microsoft.Security.Extensions 1.3.0 - MIT +(c) Microsoft Corporation +Copyright (c) Microsoft Corporation MIT License From fa3aa1647527c032a6faa54b35b44f70b16d7dae Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 8 Nov 2023 18:34:41 -0800 Subject: [PATCH 0135/1168] Make internal .NET SDK URL as a parameter for release builld (#20655) --- tools/releaseBuild/azureDevOps/compliance.yml | 8 ++++++++ tools/releaseBuild/azureDevOps/releaseBuild.yml | 5 +++++ .../azureDevOps/templates/compliance/apiscan.yml | 1 - .../azureDevOps/templates/linux-packaging.yml | 1 - .../releaseBuild/azureDevOps/templates/linux.yml | 1 - .../azureDevOps/templates/mac-package-build.yml | 2 -- tools/releaseBuild/azureDevOps/templates/mac.yml | 2 -- .../azureDevOps/templates/nuget-pkg-sbom.yml | 15 +++++++++++++++ .../releaseBuild/azureDevOps/templates/nuget.yml | 1 - .../templates/release-GlobalToolTest.yml | 3 --- .../azureDevOps/templates/release-SDKTests.yml | 2 -- .../templates/release-ValidateFxdPackage.yml | 1 - .../azureDevOps/templates/testartifacts.yml | 2 -- .../templates/windows-hosted-build.yml | 1 - .../azureDevOps/templates/windows-packaging.yml | 1 - 15 files changed, 28 insertions(+), 18 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/compliance.yml b/tools/releaseBuild/azureDevOps/compliance.yml index 57c29194de6..1940ff6ca89 100644 --- a/tools/releaseBuild/azureDevOps/compliance.yml +++ b/tools/releaseBuild/azureDevOps/compliance.yml @@ -19,6 +19,11 @@ resources: name: PowerShell/compliance ref: master +parameters: +- name: InternalSDKBlobURL + displayName: URL to the blob havibg internal .NET SDK + type: string + variables: - name: DOTNET_CLI_TELEMETRY_OPTOUT value: 1 @@ -33,6 +38,9 @@ variables: # Defines the variables CgPat, CgOrganization, and CgProject - group: 'ComponentGovernance' - group: 'PoolNames' + - name: __DOTNET_RUNTIME_FEED + value: ${{ parameters.InternalSDKBlobURL }} + stages: - stage: compliance diff --git a/tools/releaseBuild/azureDevOps/releaseBuild.yml b/tools/releaseBuild/azureDevOps/releaseBuild.yml index dd576e1860d..434d17df454 100644 --- a/tools/releaseBuild/azureDevOps/releaseBuild.yml +++ b/tools/releaseBuild/azureDevOps/releaseBuild.yml @@ -18,6 +18,9 @@ parameters: - true - false default: false + - name: InternalSDKBlobURL + displayName: URL to the blob having internal .NET SDK + type: string resources: repositories: @@ -54,6 +57,8 @@ variables: - name: BUILDSECMON_OPT_IN value: true - group: PoolNames + - name: __DOTNET_RUNTIME_FEED + value: ${{ parameters.InternalSDKBlobURL }} stages: - stage: prep diff --git a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml index a2605c398ae..9b9e86372ee 100644 --- a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml +++ b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml @@ -42,7 +42,6 @@ jobs: retryCountOnTaskFailure: 2 displayName: 'Bootstrap' env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | diff --git a/tools/releaseBuild/azureDevOps/templates/linux-packaging.yml b/tools/releaseBuild/azureDevOps/templates/linux-packaging.yml index 4439ded9f26..59db37c64ac 100644 --- a/tools/releaseBuild/azureDevOps/templates/linux-packaging.yml +++ b/tools/releaseBuild/azureDevOps/templates/linux-packaging.yml @@ -253,7 +253,6 @@ jobs: condition: and(succeeded(), ne(variables['SkipBuild'], 'true')) workingDirectory: $(PowerShellRoot) env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - powershell: | diff --git a/tools/releaseBuild/azureDevOps/templates/linux.yml b/tools/releaseBuild/azureDevOps/templates/linux.yml index a65045ce323..bb343bed54e 100644 --- a/tools/releaseBuild/azureDevOps/templates/linux.yml +++ b/tools/releaseBuild/azureDevOps/templates/linux.yml @@ -62,7 +62,6 @@ jobs: condition: and(succeeded(), ne(variables['SkipBuild'], 'true')) workingDirectory: $(PowerShellRoot) env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | diff --git a/tools/releaseBuild/azureDevOps/templates/mac-package-build.yml b/tools/releaseBuild/azureDevOps/templates/mac-package-build.yml index f3801deaa9e..c853a21ef37 100644 --- a/tools/releaseBuild/azureDevOps/templates/mac-package-build.yml +++ b/tools/releaseBuild/azureDevOps/templates/mac-package-build.yml @@ -119,7 +119,6 @@ jobs: } displayName: 'Bootstrap VM' env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | @@ -133,7 +132,6 @@ jobs: } displayName: 'Package' env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 diff --git a/tools/releaseBuild/azureDevOps/templates/mac.yml b/tools/releaseBuild/azureDevOps/templates/mac.yml index f13c00ef421..892064fbbba 100644 --- a/tools/releaseBuild/azureDevOps/templates/mac.yml +++ b/tools/releaseBuild/azureDevOps/templates/mac.yml @@ -43,7 +43,6 @@ jobs: tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 -location $(PowerShellRoot) -BootStrap displayName: 'Bootstrap VM' env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - template: /tools/releaseBuild/azureDevOps/templates/insert-nuget-config-azfeed.yml @@ -58,7 +57,6 @@ jobs: $env:AzDevOpsFeedPAT2 = $null displayName: 'Build' env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 diff --git a/tools/releaseBuild/azureDevOps/templates/nuget-pkg-sbom.yml b/tools/releaseBuild/azureDevOps/templates/nuget-pkg-sbom.yml index f0a033fd9e4..276ab1511cd 100644 --- a/tools/releaseBuild/azureDevOps/templates/nuget-pkg-sbom.yml +++ b/tools/releaseBuild/azureDevOps/templates/nuget-pkg-sbom.yml @@ -20,6 +20,19 @@ parameters: steps: +- pwsh: | + $configPath = "$(REPOROOT)/nuget.config" + Import-Module '$(REPOROOT)/build.psm1' -Force + New-NugetConfigFile -NugetFeedUrl $(PSInternalNugetFeed) -UserName $(PSInternalNugetFeedUserName) -ClearTextPAT $(PSInternalNugetFeedPAT) -FeedName AzDevOpsFeed -Destination "$(REPOROOT)" + + if(-not (Test-Path $configPath)) + { + throw "nuget.config is not created" + } + Get-Content $configPath | Write-Verbose -Verbose + displayName: 'Add nuget.config for Azure DevOps feed for packages' + condition: and(succeededOrFailed(), ne(variables['PSInternalNugetFeed'], '')) + - pwsh: | Import-Module "$env:REPOROOT/build.psm1" -Force Start-PSBootstrap @@ -81,6 +94,8 @@ steps: Write-Host "##$vstsCommandString" displayName: Build reference assemblies + env: + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - ${{ each value in parameters.ListOfFiles }}: - pwsh: | diff --git a/tools/releaseBuild/azureDevOps/templates/nuget.yml b/tools/releaseBuild/azureDevOps/templates/nuget.yml index 247e91013a3..702e33b7e83 100644 --- a/tools/releaseBuild/azureDevOps/templates/nuget.yml +++ b/tools/releaseBuild/azureDevOps/templates/nuget.yml @@ -60,7 +60,6 @@ jobs: Start-PSBootStrap -Verbose displayName: Bootstrap env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - task: DownloadBuildArtifacts@0 diff --git a/tools/releaseBuild/azureDevOps/templates/release-GlobalToolTest.yml b/tools/releaseBuild/azureDevOps/templates/release-GlobalToolTest.yml index cc6af2d8526..8591791de0e 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-GlobalToolTest.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-GlobalToolTest.yml @@ -61,7 +61,6 @@ jobs: displayName: Install .NET env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | @@ -85,7 +84,6 @@ jobs: displayName: Install global tool env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | @@ -148,5 +146,4 @@ jobs: } displayName: Basic validation env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) diff --git a/tools/releaseBuild/azureDevOps/templates/release-SDKTests.yml b/tools/releaseBuild/azureDevOps/templates/release-SDKTests.yml index 2279c3325e1..880967a37a7 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-SDKTests.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-SDKTests.yml @@ -97,7 +97,6 @@ jobs: displayName: Install .NET env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | @@ -136,7 +135,6 @@ jobs: displayName: Restore and execute tests env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - task: PublishTestResults@2 diff --git a/tools/releaseBuild/azureDevOps/templates/release-ValidateFxdPackage.yml b/tools/releaseBuild/azureDevOps/templates/release-ValidateFxdPackage.yml index 1aa88af9143..7f2c816a20f 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-ValidateFxdPackage.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-ValidateFxdPackage.yml @@ -38,7 +38,6 @@ jobs: Write-Verbose -Message "Installing .NET SDK completed." -Verbose displayName: Install .NET env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | diff --git a/tools/releaseBuild/azureDevOps/templates/testartifacts.yml b/tools/releaseBuild/azureDevOps/templates/testartifacts.yml index 09f5c5bce5d..43c09236da9 100644 --- a/tools/releaseBuild/azureDevOps/templates/testartifacts.yml +++ b/tools/releaseBuild/azureDevOps/templates/testartifacts.yml @@ -25,7 +25,6 @@ jobs: Start-PSBootstrap displayName: Bootstrap env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | @@ -86,7 +85,6 @@ jobs: Start-PSBootstrap displayName: Bootstrap env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | diff --git a/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml b/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml index b533061178f..4b36f6f396e 100644 --- a/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml +++ b/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml @@ -66,7 +66,6 @@ jobs: tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 -location '$(PowerShellRoot)' -destination '$(Build.ArtifactStagingDirectory)/Symbols_$(Architecture)' -Runtime $runtime -ReleaseTag '$(ReleaseTagVar)' -Symbols @params displayName: 'Build Windows Universal - $(Architecture)-$(BuildConfiguration) Symbols zip' env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | diff --git a/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml b/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml index 91a5c15f112..4d1273d135d 100644 --- a/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml +++ b/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml @@ -259,7 +259,6 @@ jobs: $(PowerShellRoot)/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 -BuildZip $signedPkg -location '$(PowerShellRoot)' -destination '$(System.ArtifactsDirectory)\pkgSigned' -Runtime $runtime -ReleaseTag '$(ReleaseTagVar)' @params displayName: 'Build Windows Universal - $(Architecture) Package' env: - __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - pwsh: | From 9ff866d908151f7b61d4d240454780b1071be4a2 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Thu, 9 Nov 2023 14:01:11 -0500 Subject: [PATCH 0136/1168] Update `PSResourceGet` version for `1.0.1` release (#20652) --- src/Modules/PSGalleryModules.csproj | 2 +- .../Modules/PowerShellGet/PowerShellGet.Tests.ps1 | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Modules/PSGalleryModules.csproj b/src/Modules/PSGalleryModules.csproj index 80a1b7e2022..0dd1a39c68f 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index fb5d632765c..1fd935b22dd 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -145,15 +145,10 @@ Describe "PowerShellGet - Module tests" -tags "Feature" { It "Should install a module correctly to the required location with default CurrentUser scope" { Install-Module -Name $TestModule -Repository $RepositoryName - $installedModuleInfo = Get-InstalledModule -Name $TestModule - - $installedModuleInfo | Should -Not -BeNullOrEmpty - $installedModuleInfo.Name | Should -Be $TestModule - $installedModuleInfo.InstalledLocation.StartsWith($script:MyDocumentsModulesPath, [System.StringComparison]::OrdinalIgnoreCase) | Should -BeTrue - - $module = Get-Module $TestModule -ListAvailable + $module = Get-Module -Name $TestModule -ListAvailable + $module | Should -Not -BeNullOrEmpty $module.Name | Should -Be $TestModule - $module.ModuleBase | Should -Be $installedModuleInfo.InstalledLocation + $module.ModuleBase.StartsWith($script:MyDocumentsModulesPath, [System.StringComparison]::OrdinalIgnoreCase) | Should -BeTrue } AfterAll { From 341c9a7e5f5f2357e50a43d91f0cee4f18ef4a30 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 9 Nov 2023 11:28:35 -0800 Subject: [PATCH 0137/1168] Fix release build by making the internal SDK parameter optional (#20658) --- build.psm1 | 2 +- tools/releaseBuild/azureDevOps/compliance.yml | 1 + tools/releaseBuild/azureDevOps/releaseBuild.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index a53a13db908..55110cd9cf6 100644 --- a/build.psm1 +++ b/build.psm1 @@ -20,7 +20,7 @@ $dotnetMetadata = Get-Content $PSScriptRoot/DotnetRuntimeMetadata.json | Convert $dotnetCLIChannel = $dotnetMetadata.Sdk.Channel $dotnetCLIQuality = $dotnetMetadata.Sdk.Quality # __DOTNET_RUNTIME_FEED and __DOTNET_RUNTIME_FEED_KEY are private variables used in release builds -$dotnetAzureFeed = if (-not $env:__DOTNET_RUNTIME_FEED ) { $dotnetMetadata.Sdk.azureFeed } else { $env:__DOTNET_RUNTIME_FEED } +$dotnetAzureFeed = if ([string]::IsNullOrWhiteSpace($env:__DOTNET_RUNTIME_FEED)) { $dotnetMetadata.Sdk.azureFeed } else { $env:__DOTNET_RUNTIME_FEED } $dotnetAzureFeedSecret = $env:__DOTNET_RUNTIME_FEED_KEY $dotnetSDKVersionOveride = $dotnetMetadata.Sdk.sdkImageOverride $dotnetCLIRequiredVersion = $(Get-Content $PSScriptRoot/global.json | ConvertFrom-Json).Sdk.Version diff --git a/tools/releaseBuild/azureDevOps/compliance.yml b/tools/releaseBuild/azureDevOps/compliance.yml index 1940ff6ca89..3624f1e1081 100644 --- a/tools/releaseBuild/azureDevOps/compliance.yml +++ b/tools/releaseBuild/azureDevOps/compliance.yml @@ -23,6 +23,7 @@ parameters: - name: InternalSDKBlobURL displayName: URL to the blob havibg internal .NET SDK type: string + default: ' ' variables: - name: DOTNET_CLI_TELEMETRY_OPTOUT diff --git a/tools/releaseBuild/azureDevOps/releaseBuild.yml b/tools/releaseBuild/azureDevOps/releaseBuild.yml index 434d17df454..3be90bbefbc 100644 --- a/tools/releaseBuild/azureDevOps/releaseBuild.yml +++ b/tools/releaseBuild/azureDevOps/releaseBuild.yml @@ -21,6 +21,7 @@ parameters: - name: InternalSDKBlobURL displayName: URL to the blob having internal .NET SDK type: string + default: ' ' resources: repositories: From 990d2112a8b9e7f4609620fabfb82a5560c724eb Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 10 Nov 2023 10:12:07 -0800 Subject: [PATCH 0138/1168] Copy azure blob with PowerShell global tool to private blob and move to CDN during release (#20659) --- .../azureDevOps/releasePipeline.yml | 60 ++++++++++++++----- .../azureDevOps/templates/nuget.yml | 2 +- .../templates/release-CopyGlobalTools.yml | 56 +++++++++++++++++ .../release-SetReleaseTagAndContainerName.yml | 5 ++ 4 files changed, 106 insertions(+), 17 deletions(-) create mode 100644 tools/releaseBuild/azureDevOps/templates/release-CopyGlobalTools.yml diff --git a/tools/releaseBuild/azureDevOps/releasePipeline.yml b/tools/releaseBuild/azureDevOps/releasePipeline.yml index fb6b8d5d956..05dbe1799e2 100644 --- a/tools/releaseBuild/azureDevOps/releasePipeline.yml +++ b/tools/releaseBuild/azureDevOps/releasePipeline.yml @@ -290,8 +290,8 @@ stages: Update and merge the changelog for the release. This step is required for creating GitHub draft release. -- stage: GitHubDraftRelease - displayName: Create GitHub draft release +- stage: BlobPublic + displayName: Make Blob Public # do not include stages that are likely to fail in dependency as there is no way to force deploy. dependsOn: UpdateChangeLog @@ -314,6 +314,38 @@ stages: steps: - template: templates/release-MakeContainerPublic.yml + - template: templates/release/approvalJob.yml + parameters: + displayName: Copy Global tool packages to PSInfra storage + jobName: CopyBlobApproval + instructions: | + Approval for Copy global tool packages to PSInfra storage + + - job: PSInfraBlobPublic + displayName: Copy global tools to PSInfra storage + dependsOn: CopyBlobApproval + + pool: + name: PowerShell1ES + demands: + - ImageOverride -equals PSMMS2019-Secure + + variables: + - group: 'PSInfraStorage' + + steps: + - template: templates/release-CopyGlobalTools.yml + parameters: + sourceContainerName: 'tool-private' + destinationContainerName: 'tool' + sourceStorageAccountName: '$(GlobalToolStorageAccount)' + destinationStorageAccountName: '$(PSInfraStorageAccount)' + blobPrefix: '$(Version)' + +- stage: GitHubTasks + displayName: GitHub tasks + dependsOn: BlobPublic + jobs: - job: GitHubDraft displayName: Create GitHub Draft release @@ -326,28 +358,24 @@ stages: - group: 'Azure Blob variable group' - group: 'AzDevOpsArtifacts' - group: ReleasePipelineSecrets - dependsOn: AzureBlobPublic steps: - template: templates/release-CreateGitHubDraft.yml -- stage: GitHubManualTasks - displayName: GitHub manual tasks - dependsOn: GitHubDraftRelease - jobs: - deployment: PushTag + dependsOn: GitHubDraft displayName: Push Git Tag pool : server environment: PSReleasePushTag - deployment: MakeDraftPublic + dependsOn: PushTag displayName: Make GitHub Draft public pool : server environment: PSReleaseDraftPublic - dependsOn: PushTag - stage: PublishPackages displayName: Publish packages - dependsOn: GitHubManualTasks + dependsOn: GitHubTasks jobs: - job: PublishNuget @@ -405,7 +433,7 @@ stages: - stage: ReleaseDocker displayName: Release Docker dependsOn: - - GitHubManualTasks + - GitHubTasks jobs: - deployment: ReleaseDocker displayName: Release Docker @@ -504,7 +532,7 @@ stages: Notify the PM team to start the process of releasing to MU. - stage: UpdateDotnetDocker - dependsOn: GitHubManualTasks + dependsOn: GitHubTasks displayName: Update DotNet SDK Docker images jobs: - template: templates/release/approvalJob.yml @@ -519,7 +547,7 @@ stages: 4. create PR targeting nightly branch - stage: UpdateWinGet - dependsOn: GitHubManualTasks + dependsOn: GitHubTasks displayName: Add manifest entry to winget jobs: - template: templates/release/approvalJob.yml @@ -530,7 +558,7 @@ stages: This is typically done by the community 1-2 days after the release. - stage: PublishMsix - dependsOn: GitHubManualTasks + dependsOn: GitHubTasks displayName: Publish MSIX to store jobs: - template: templates/release/approvalJob.yml @@ -541,7 +569,7 @@ stages: Ask Steve to release MSIX bundle package to Store - stage: BuildInfoJson - dependsOn: GitHubManualTasks + dependsOn: GitHubTasks displayName: Upload BuildInfoJson jobs: - deployment: UploadJson @@ -562,7 +590,7 @@ stages: - template: templates/release-BuildJson.yml - stage: ReleaseVPack - dependsOn: GitHubManualTasks + dependsOn: GitHubTasks displayName: Release VPack jobs: - job: KickoffvPack @@ -611,7 +639,7 @@ stages: } - stage: ReleaseDeps - dependsOn: GitHubManualTasks + dependsOn: GitHubTasks displayName: Update pwsh.deps.json links jobs: - template: templates/release-UpdateDepsJson.yml diff --git a/tools/releaseBuild/azureDevOps/templates/nuget.yml b/tools/releaseBuild/azureDevOps/templates/nuget.yml index 702e33b7e83..22f791bf0eb 100644 --- a/tools/releaseBuild/azureDevOps/templates/nuget.yml +++ b/tools/releaseBuild/azureDevOps/templates/nuget.yml @@ -279,7 +279,7 @@ jobs: azureSubscription: '$(GlobalToolSubscription)' Destination: AzureBlob storage: '$(GlobalToolStorageAccount)' - ContainerName: 'tool' + ContainerName: 'tool-private' blobPrefix: '$(Version)' condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'true')) retryCountOnTaskFailure: 2 diff --git a/tools/releaseBuild/azureDevOps/templates/release-CopyGlobalTools.yml b/tools/releaseBuild/azureDevOps/templates/release-CopyGlobalTools.yml new file mode 100644 index 00000000000..7c9306496ed --- /dev/null +++ b/tools/releaseBuild/azureDevOps/templates/release-CopyGlobalTools.yml @@ -0,0 +1,56 @@ +parameters: +- name: sourceContainerName + type: string + default: 'source-container' + +- name: destinationContainerName + type: string + default: 'destination-container' + +- name: sourceStorageAccountName + type: string + default: 'source-storage-account' + +- name: destinationStorageAccountName + type: string + default: 'destination-storage-account' + +- name: blobPrefix + type: string + default: '$(Version)' + +steps: +- template: release-SetReleaseTagAndContainerName.yml + +- pwsh: | + Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1' + Install-AzCopy + displayName: Install AzCopy + retryCountOnTaskFailure: 2 + +- pwsh: | + Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1' + $azcopy = Find-AzCopy + Write-Verbose -Verbose "Found AzCopy: $azcopy" + + $sourceContainerName = "${{ parameters.sourceContainerName }}" + $destinationContainerName = "${{ parameters.destinationContainerName }}" + $sourceStorageAccountName = "${{ parameters.sourceStorageAccountName }}" + $destinationStorageAccountName = "${{ parameters.destinationStorageAccountName }}" + $blobPrefix = "${{ parameters.blobPrefix }}" + + $sourceBlobUrl = "https://${sourceStorageAccountName}.blob.core.windows.net/${sourceContainerName}/${blobPrefix}" + Write-Verbose -Verbose "Source blob url: $sourceBlobUrl" + $destinationBlobUrl = "https://${destinationStorageAccountName}.blob.core.windows.net/${destinationContainerName}" + Write-Verbose -Verbose "Destination blob url: $destinationBlobUrl" + + & $azcopy cp $sourceBlobUrl $destinationBlobUrl --recursive + + $packagesPath = Get-ChildItem -Path $(System.ArtifactsDirectory)\*.deb -Recurse -File | Select-Object -First 1 -ExpandProperty DirectoryName + Write-Host "sending -- vso[task.setvariable variable=PackagesRoot]$packagesPath" + Write-Host "##vso[task.setvariable variable=PackagesRoot]$packagesPath" + + displayName: Copy blobs + retryCountOnTaskFailure: 2 + env: + AZCOPY_AUTO_LOGIN_TYPE: MSI diff --git a/tools/releaseBuild/azureDevOps/templates/release-SetReleaseTagAndContainerName.yml b/tools/releaseBuild/azureDevOps/templates/release-SetReleaseTagAndContainerName.yml index 26229325b82..7e88624b45c 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-SetReleaseTagAndContainerName.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-SetReleaseTagAndContainerName.yml @@ -18,4 +18,9 @@ steps: $vstsCommandString = "vso[task.setvariable variable=AzureVersion]$azureVersion" Write-Host "sending " + $vstsCommandString Write-Host "##$vstsCommandString" + + $version = '$(ReleaseTag)'.ToLowerInvariant().Substring(1) + $vstsCommandString = "vso[task.setvariable variable=Version]$version" + Write-Host ("sending " + $vstsCommandString) + Write-Host "##$vstsCommandString" displayName: Set container name From d06eeb51bdd23b9d471455e1fb189969bbba15e3 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 10 Nov 2023 13:01:41 -0800 Subject: [PATCH 0139/1168] Add internal nuget feed to compliance build (#20669) --- .../azureDevOps/templates/compliance/apiscan.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml index 9b9e86372ee..76ef145886f 100644 --- a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml +++ b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml @@ -35,6 +35,12 @@ jobs: CreateJson: yes UseJson: no + - template: ../cloneToOfficialPath.yml + + - template: ../insert-nuget-config-azfeed.yml + parameters: + repoRoot: $(PowerShellRoot) + - pwsh: | Import-Module .\build.psm1 -force Start-PSBootstrap From 69e3e8b061a353378599a16fd5ef87bd3910632d Mon Sep 17 00:00:00 2001 From: Steven Bucher Date: Mon, 13 Nov 2023 14:24:32 -0800 Subject: [PATCH 0140/1168] Adding bot logic for closing GitHub issues after 6 months of no activity (#20525) --- .github/policies/resourceManagement.yml | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml index edad3b2e486..0387fb7189e 100644 --- a/.github/policies/resourceManagement.yml +++ b/.github/policies/resourceManagement.yml @@ -205,7 +205,49 @@ configuration: - addReply: reply: This issue has been marked as "Waiting on Author" and has not had any activity for **7 day**. It has been closed for housekeeping purposes. - closeIssue + - description: Resolution no activity + frequencies: + - hourly: + hour: 12 + filters: + - isOpen + - isIssue + - hasLabel: + label: Resolution-No Activity + - noActivitySince: + days: 7 + actions: + - addReply: + reply: This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes. + + - closeIssue + - description: This is for closing issues that have no activity for 6 months. + frequencies: + - hourly: + hour: 24 + filters: + - isIssue + - isOpen + - isNotLabeledWith: + label: KeepOpen + - noActivitySince: + days: 180 + actions: + - addReply: + reply: This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. + - addLabel: + label: Resolution-No Activity eventResponderTasks: + - if: + - payloadType: Issue_Comment + - isActivitySender: + issueAuthor: True + - hasLabel: + label: Resolution-No Activity + then: + - removeLabel: + label: Resolution-No Activity + description: Reopen issues with no activity if its the author who has commented - if: - payloadType: Pull_Request - hasLabel: From 5cd04f2377b624dedd17a85ff3f38a0343292477 Mon Sep 17 00:00:00 2001 From: Steven Bucher Date: Mon, 13 Nov 2023 14:33:52 -0800 Subject: [PATCH 0141/1168] add psadapter and console gui tools to module load telemetry whitelist (#20641) --- src/System.Management.Automation/utils/Telemetry.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/System.Management.Automation/utils/Telemetry.cs b/src/System.Management.Automation/utils/Telemetry.cs index 5588cb103a7..020d009b107 100644 --- a/src/System.Management.Automation/utils/Telemetry.cs +++ b/src/System.Management.Automation/utils/Telemetry.cs @@ -444,6 +444,7 @@ static ApplicationInsightsTelemetry() "Microsoft.Medv.Administration.Commands.WorkspacePackager", "Microsoft.PowerApps.Checker.PowerShell", "Microsoft.PowerShell.Archive", + "Microsoft.PowerShell.ConsoleGuiTools", "Microsoft.PowerShell.Core", "Microsoft.PowerShell.Crescendo", "Microsoft.PowerShell.Diagnostics", @@ -452,6 +453,7 @@ static ApplicationInsightsTelemetry() "Microsoft.PowerShell.Management", "Microsoft.PowerShell.ODataUtils", "Microsoft.PowerShell.Operation.Validation", + "Microsoft.PowerShell.PSAdapter", "Microsoft.PowerShell.PSResourceGet", "Microsoft.PowerShell.RemotingTools", "Microsoft.PowerShell.SecretManagement", From 094e22e97ddcb982687f5e7a66c2567907e51124 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 16 Nov 2023 10:04:58 -0800 Subject: [PATCH 0142/1168] Update README and metadata.json for upcoming releases (#20696) --- README.md | 54 +++++++++---------- .../Language/Scripting/Requires.Tests.ps1 | 2 +- tools/metadata.json | 8 +-- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 084e7e2d651..7c0e79ac67e 100644 --- a/README.md +++ b/README.md @@ -64,33 +64,33 @@ You can also download the PowerShell binary archives for Windows, macOS, and Lin | Windows (ARM) | [64-bit][rl-winarm64] (preview) | [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-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.16/PowerShell-7.2.16-win-x86.msi -[lts-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.16/PowerShell-7.2.16-win-x64.msi -[lts-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.16/powershell-lts_7.2.16-1.deb_amd64.deb -[lts-rh]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.16/powershell-lts-7.2.16-1.rh.x86_64.rpm -[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.16/powershell-lts-7.2.16-osx-x64.pkg -[lts-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.16/powershell-lts-7.2.16-osx-arm64.pkg - -[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/PowerShell-7.3.9-win-x64.msi -[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/PowerShell-7.3.9-win-x86.msi -[rl-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell_7.3.9-1.deb_amd64.deb -[rl-ubuntu22]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell_7.3.9-1.deb_amd64.deb -[rl-ubuntu20]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell_7.3.9-1.deb_amd64.deb -[rl-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell_7.3.9-1.deb_amd64.deb -[rl-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell_7.3.9-1.deb_amd64.deb -[rl-debian11]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell_7.3.9-1.deb_amd64.deb -[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-1.rh.x86_64.rpm -[rl-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-1.rh.x86_64.rpm -[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-osx-x64.pkg -[rl-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-osx-arm64.pkg -[rl-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/PowerShell-7.3.9-win-arm64.zip -[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/PowerShell-7.3.9-win-x86.zip -[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/PowerShell-7.3.9-win-x64.zip -[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-osx-x64.tar.gz -[rl-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-osx-arm64.tar.gz -[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-linux-x64.tar.gz -[rl-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-linux-arm32.tar.gz -[rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.3.9/powershell-7.3.9-linux-arm64.tar.gz +[lts-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.17/PowerShell-7.2.17-win-x86.msi +[lts-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.17/PowerShell-7.2.17-win-x64.msi +[lts-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.17/powershell-lts_7.2.17-1.deb_amd64.deb +[lts-rh]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.17/powershell-lts-7.2.17-1.rh.x86_64.rpm +[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.17/powershell-lts-7.2.17-osx-x64.pkg +[lts-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.17/powershell-lts-7.2.17-osx-arm64.pkg + +[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x64.msi +[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x86.msi +[rl-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb +[rl-ubuntu22]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb +[rl-ubuntu20]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb +[rl-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb +[rl-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb +[rl-debian11]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb +[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-1.rh.x86_64.rpm +[rl-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-1.rh.x86_64.rpm +[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-osx-x64.pkg +[rl-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-osx-arm64.pkg +[rl-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-arm64.zip +[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x86.zip +[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x64.zip +[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-osx-x64.tar.gz +[rl-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-osx-arm64.tar.gz +[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-linux-x64.tar.gz +[rl-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-linux-arm32.tar.gz +[rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-linux-arm64.tar.gz [rl-snap]: https://snapcraft.io/powershell [pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/PowerShell-7.4.0-rc.1-win-x64.msi diff --git a/test/powershell/Language/Scripting/Requires.Tests.ps1 b/test/powershell/Language/Scripting/Requires.Tests.ps1 index 1625e0b3c18..30a600fe4b7 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", "7.1", "7.2", "7.3", "7.4" + $powerShellVersions = "1.0", "2.0", "3.0", "4.0", "5.0", "5.1", "6.0", "6.1", "6.2", "7.0", "7.1", "7.2", "7.3", "7.4", "7.5" $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 997a7db753d..b548546b249 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,10 +1,10 @@ { - "StableReleaseTag": "v7.3.9", + "StableReleaseTag": "v7.4.0", "PreviewReleaseTag": "v7.4.0-rc.1", "ServicingReleaseTag": "v7.0.13", - "ReleaseTag": "v7.3.9", - "LTSReleaseTag" : ["v7.2.16"], - "NextReleaseTag": "v7.4.0-preview.7", + "ReleaseTag": "v7.4.0", + "LTSReleaseTag" : ["v7.2.17", "v7.4.0"], + "NextReleaseTag": "v7.5.0-preview.1", "LTSRelease": { "Latest": false, "Package": false }, "StableRelease": { "Latest": false, "Package": false } } From 12aa039634e594defc9602c4d1adf67790cc4cbf Mon Sep 17 00:00:00 2001 From: LNKLEO Date: Thu, 23 Nov 2023 16:50:21 +0800 Subject: [PATCH 0143/1168] Fix report wrong size on Invoke-WebRequest with -Resume switcher #20206 (#20207) --- .../WebCmdlet/CoreCLR/InvokeWebRequestCommand.CoreClr.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 026bbe866e5..78388f74de0 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 @@ -65,7 +65,9 @@ internal override void ProcessResponse(HttpResponseMessage response) WriteVerbose(string.Create(System.Globalization.CultureInfo.InvariantCulture, $"File Name: {Path.GetFileName(_qualifiedOutFile)}")); - StreamHelper.SaveStreamToFile(responseStream, outFilePath, this, response.Content.Headers.ContentLength.GetValueOrDefault(), perReadTimeout, _cancelToken.Token); + // ContentLength is always the partial length, while ContentRange is the full length + // Without Request.Range set, ContentRange is null and partial length (ContentLength) equals to full length + StreamHelper.SaveStreamToFile(responseStream, outFilePath, this, response.Content.Headers.ContentRange?.Length.GetValueOrDefault() ?? response.Content.Headers.ContentLength.GetValueOrDefault(), perReadTimeout, _cancelToken.Token); } } From d4470892d3bc82f45ffee1e63c81281d3ff3e79f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:06:59 +0000 Subject: [PATCH 0144/1168] Bump JsonSchema.Net from 5.2.6 to 5.4.0 (#20736) Bumps [JsonSchema.Net](https://github.com/gregsdennis/json-everything) from 5.2.6 to 5.4.0. - [Commits](https://github.com/gregsdennis/json-everything/commits) --- updated-dependencies: - dependency-name: JsonSchema.Net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[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 a23b657f61e..861097b3437 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -35,7 +35,7 @@ - + From 811efa46df822bf7be6179b6219f9f9d160eb7d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 08:44:35 +0500 Subject: [PATCH 0145/1168] Bump Microsoft.CodeAnalysis.CSharp from 4.8.0-2.final to 4.8.0 (#20751) Bumps [Microsoft.CodeAnalysis.CSharp](https://github.com/dotnet/roslyn) from 4.8.0-2.final to 4.8.0. - [Release notes](https://github.com/dotnet/roslyn/releases) - [Changelog](https://github.com/dotnet/roslyn/blob/main/docs/Breaking%20API%20Changes.md) - [Commits](https://github.com/dotnet/roslyn/commits) --- updated-dependencies: - dependency-name: Microsoft.CodeAnalysis.CSharp dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- .../PSVersionInfoGenerator/PSVersionInfoGenerator.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 861097b3437..4e4995c36d4 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,7 +32,7 @@ - + diff --git a/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj b/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj index 4cc9ed73321..9086cd56703 100644 --- a/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj +++ b/src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj @@ -13,7 +13,7 @@ - + From f37f7dbb0ae837475448d6d5c6d8c9876694fba5 Mon Sep 17 00:00:00 2001 From: Steven Bucher Date: Mon, 27 Nov 2023 10:04:10 -0800 Subject: [PATCH 0146/1168] Adding field to prevent multiple comments about no activityu (#20758) --- .github/policies/resourceManagement.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml index 0387fb7189e..5a9bfac1d87 100644 --- a/.github/policies/resourceManagement.yml +++ b/.github/policies/resourceManagement.yml @@ -230,6 +230,8 @@ configuration: - isOpen - isNotLabeledWith: label: KeepOpen + - isNotLabeledWith: + label: Resolution-No Activity - noActivitySince: days: 180 actions: From 14245e0405d0e956743a1e3f2006fa335e0d5550 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Wed, 29 Nov 2023 01:08:11 -0800 Subject: [PATCH 0147/1168] Fix rendering of DisplayRoot for network PSDrive (#20793) --- .../Interop/Windows/WNetGetConnection.cs | 23 +++++++++---------- .../New-PSDrive.Tests.ps1 | 6 +++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/System.Management.Automation/engine/Interop/Windows/WNetGetConnection.cs b/src/System.Management.Automation/engine/Interop/Windows/WNetGetConnection.cs index bf7742526f1..fcdaeb65d3c 100644 --- a/src/System.Management.Automation/engine/Interop/Windows/WNetGetConnection.cs +++ b/src/System.Management.Automation/engine/Interop/Windows/WNetGetConnection.cs @@ -13,8 +13,8 @@ internal static unsafe partial class Windows { private static bool s_WNetApiNotAvailable; - [LibraryImport("mpr.dll", EntryPoint = "WNetGetConnectionW")] - internal static partial int WNetGetConnection(ReadOnlySpan localName, Span remoteName, ref uint remoteNameLength); + [LibraryImport("mpr.dll", EntryPoint = "WNetGetConnectionW", StringMarshalling = StringMarshalling.Utf16)] + internal static partial int WNetGetConnection(ReadOnlySpan localName, Span remoteName, ref uint remoteNameLength); internal static int GetUNCForNetworkDrive(char drive, out string? uncPath) { @@ -33,11 +33,8 @@ internal static int GetUNCForNetworkDrive(char drive, out string? uncPath) bufferSize = 3; #endif - // TODO: change ushort with char after LibraryImport will support 'ref char' - // without applying the 'System.Runtime.CompilerServices.DisableRuntimeMarshallingAttribute' - // to the assembly. - ReadOnlySpan driveName = stackalloc ushort[] { drive, ':', '\0' }; - Span uncBuffer = stackalloc ushort[(int)bufferSize]; + ReadOnlySpan driveName = stackalloc char[] { drive, ':', '\0' }; + Span uncBuffer = stackalloc char[(int)bufferSize]; int errorCode = ERROR_NO_NETWORK; try @@ -52,26 +49,28 @@ internal static int GetUNCForNetworkDrive(char drive, out string? uncPath) if (errorCode == ERROR_SUCCESS) { - uncPath = uncBuffer.Slice((int)bufferSize).ToString(); + // exclude null terminator + uncPath = uncBuffer.Slice(0, (int)bufferSize - 1).ToString(); } else if (errorCode == ERROR_MORE_DATA) { - ushort[]? rentedArray = null; + char[]? rentedArray = null; try { - uncBuffer = rentedArray = ArrayPool.Shared.Rent((int)bufferSize); + uncBuffer = rentedArray = ArrayPool.Shared.Rent((int)bufferSize); errorCode = WNetGetConnection(driveName, uncBuffer, ref bufferSize); if (errorCode == ERROR_SUCCESS) { - uncPath = uncBuffer.Slice((int)bufferSize).ToString(); + // exclude null terminator + uncPath = uncBuffer.Slice(0, (int)bufferSize - 1).ToString(); } } finally { if (rentedArray is not null) { - ArrayPool.Shared.Return(rentedArray); + ArrayPool.Shared.Return(rentedArray); } } } 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 77d76b6ec6a..3894b5a0257 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/New-PSDrive.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/New-PSDrive.Tests.ps1 @@ -17,6 +17,12 @@ Describe "Tests for New-PSDrive cmdlet." -Tag "CI","RequireAdminOnWindows" { { New-PSDrive -Name $PSDriveName -PSProvider FileSystem -Root $RemoteShare -Persist -ErrorAction Stop } | Should -Not -Throw } + It "Network drive initialization on pwsh startup DisplayRoot should have value of share" -Skip:(-not $IsWindows) { + $null = New-PSDrive -Name $PSDriveName -PSProvider FileSystem -Root $RemoteShare -Persist -ErrorAction Stop + $drive = pwsh -noprofile -outputformat XML -command "Get-PSDrive -Name $PSDriveName" + $drive.DisplayRoot | Should -Be $RemoteShare.TrimEnd('\') + } + 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' } From 272a5a98f94e852cdc67207babd6c8efa445692d Mon Sep 17 00:00:00 2001 From: Steven Bucher Date: Wed, 29 Nov 2023 10:24:36 -0800 Subject: [PATCH 0148/1168] Fixing so anyone who comments will remove the resolution no activity label (#20788) * fix bumping for keeping issues open * excess desc * repeat * clarified wording --- .github/policies/resourceManagement.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml index 5a9bfac1d87..f00f61c243d 100644 --- a/.github/policies/resourceManagement.yml +++ b/.github/policies/resourceManagement.yml @@ -219,7 +219,6 @@ configuration: actions: - addReply: reply: This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes. - - closeIssue - description: This is for closing issues that have no activity for 6 months. frequencies: @@ -242,14 +241,12 @@ configuration: eventResponderTasks: - if: - payloadType: Issue_Comment - - isActivitySender: - issueAuthor: True - hasLabel: label: Resolution-No Activity then: - removeLabel: label: Resolution-No Activity - description: Reopen issues with no activity if its the author who has commented + description: Remove resolution no activity label when anyone comments on an issue with the label. - if: - payloadType: Pull_Request - hasLabel: @@ -313,7 +310,6 @@ configuration: then: - removeLabel: label: Waiting on Author - description: - if: - payloadType: Pull_Request - not: From ac84c35820eeaf46db2d37f8b91ed4b5683c8050 Mon Sep 17 00:00:00 2001 From: Matthias Wolf <78562192+mawosoft@users.noreply.github.com> Date: Thu, 30 Nov 2023 06:13:06 +0100 Subject: [PATCH 0149/1168] Fix regression in #20608. (#20745) --- .../commands/utility/Group-Object.cs | 4 ++-- .../Microsoft.PowerShell.Utility/Group-Object.Tests.ps1 | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) 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 0f0a9951967..1f527258939 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Group-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Group-Object.cs @@ -153,7 +153,7 @@ private static string BuildName(List propValues) foreach (object item in propertyValueItems) { - sb.AppendFormat(CultureInfo.CurrentCulture, $"{item}, "); + sb.Append(CultureInfo.CurrentCulture, $"{item}, "); } sb = sb.Length > length ? sb.Remove(sb.Length - 2, 2) : sb; @@ -161,7 +161,7 @@ private static string BuildName(List propValues) } else { - sb.AppendFormat(CultureInfo.CurrentCulture, $"{propValuePropertyValue}, "); + sb.Append(CultureInfo.CurrentCulture, $"{propValuePropertyValue}, "); } } } 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 b1787bddad2..5811db60cfc 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Group-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Group-Object.Tests.ps1 @@ -130,6 +130,14 @@ Describe "Group-Object" -Tags "CI" { $result[0].Name | Should -Be "" $result[0].Group | Should -Be '@{X=}' } + + It "Should handle format-like strings with curly braces like normal strings" { + $result = '{', '}', '{0}' | Group-Object + $result.Count | Should -Be 3 + $result[0].Name | Should -BeExactly '{' + $result[1].Name | Should -BeExactly '{0}' + $result[2].Name | Should -BeExactly '}' + } } Describe "Check 'Culture' parameter in order object cmdlets (Group-Object, Sort-Object, Compare-Object)" -Tags "CI" { From ddb913871837e0074e2bae82c48f6352187ff1e1 Mon Sep 17 00:00:00 2001 From: Ryan Yates Date: Tue, 5 Dec 2023 19:40:18 +0000 Subject: [PATCH 0150/1168] Update LTS links in README.md to point to the v7.4 packages (#20839) --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7c0e79ac67e..290852aeeab 100644 --- a/README.md +++ b/README.md @@ -64,12 +64,12 @@ You can also download the PowerShell binary archives for Windows, macOS, and Lin | Windows (ARM) | [64-bit][rl-winarm64] (preview) | [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-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.17/PowerShell-7.2.17-win-x86.msi -[lts-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.17/PowerShell-7.2.17-win-x64.msi -[lts-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.17/powershell-lts_7.2.17-1.deb_amd64.deb -[lts-rh]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.17/powershell-lts-7.2.17-1.rh.x86_64.rpm -[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.17/powershell-lts-7.2.17-osx-x64.pkg -[lts-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.2.17/powershell-lts-7.2.17-osx-arm64.pkg +[lts-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x86.msi +[lts-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x64.msi +[lts-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb +[lts-rh]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-1.rh.x86_64.rpm +[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-osx-x64.pkg +[lts-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-osx-arm64.pkg [rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x64.msi [rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x86.msi From fb1f8e1d436a542fe7304fcd9f0ffc29170f94c8 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 5 Dec 2023 13:22:56 -0800 Subject: [PATCH 0151/1168] Bump .NET SDK to 8.0.0 RTM build and move the current preview changelog to `7.4.md` (#20850) --- CHANGELOG/{preview.md => 7.4.md} | 40 ++++++++++++++++++- DotnetRuntimeMetadata.json | 8 ++-- global.json | 2 +- ...oft.PowerShell.Commands.Diagnostics.csproj | 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 | 18 ++++----- .../TabCompletion/TabCompletion.Tests.ps1 | 4 +- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 +- .../azureDevOps/templates/nuget-pkg-sbom.yml | 3 +- 14 files changed, 70 insertions(+), 31 deletions(-) rename CHANGELOG/{preview.md => 7.4.md} (97%) diff --git a/CHANGELOG/preview.md b/CHANGELOG/7.4.md similarity index 97% rename from CHANGELOG/preview.md rename to CHANGELOG/7.4.md index d8ba3d0958e..5dd5481c919 100644 --- a/CHANGELOG/preview.md +++ b/CHANGELOG/7.4.md @@ -1,4 +1,42 @@ -# Current preview release +# 7.4 Changelog + +## [7.4.0] - 2023-11-16 + +### General Cmdlet Updates and Fixes + +- Added a missing `ConfigureAwait(false)` call to webcmdlets so they don't block (#20622) +- Fix `Group-Object` so output uses current culture (#20623) +- Block getting help from network locations in restricted remoting sessions (#20615) + +### Build and Packaging Improvements + +
+ + + +

Bump .NET 8 to 8.0.0 RTM build

+ +
+ +
    +
  • Add internal .NET SDK URL parameter to release pipeline (Internal 28474)
  • +
  • Update the CGManifest file for v7.4.0 release (Internal 28457)
  • +
  • Fix repository root for the nuget.config (Internal 28456)
  • +
  • Add internal nuget feed to compliance build (Internal 28449)
  • +
  • Copy azure blob with PowerShell global tool to private blob and move to CDN during release (Internal 28438)
  • +
  • Fix release build by making the internal SDK parameter optional (#20658) (Internal 28440)
  • +
  • Make internal .NET SDK URL as a parameter for release builld (#20655) (Internal 28428)
  • +
  • Update PSResourceGet version for 1.0.1 release (#20652) (Internal 28427)
  • +
  • Bump .NET 8 to 8.0.0 RTM build (Internal 28360)
  • +
  • Remove Auth header content from ErrorRecord (Internal 28409)
  • +
  • Fix setting of variable to consume internal SDK source (Internal 28354)
  • +
  • Bump Microsoft.Management.Infrastructure to v3.0.0 (Internal 28352)
  • +
  • Bump Microsoft.PowerShell.Native to v7.4.0 (#20617) (#20624)
  • +
+ +
+ +[7.4.0]: https://github.com/PowerShell/PowerShell/compare/v7.4.0-rc.1...v7.4.0 ## [7.4.0-rc.1] - 2023-10-24 diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json index 5b6ac60b802..ae6a9f9a7a6 100644 --- a/DotnetRuntimeMetadata.json +++ b/DotnetRuntimeMetadata.json @@ -1,13 +1,13 @@ { "sdk": { - "channel": "8.0.1xx-rc2", + "channel": "8.0.1xx", "quality": "daily", "qualityFallback": "preview", - "packageVersionPattern": "8.0.0-rc.2", + "packageVersionPattern": "8.0.0", "sdkImageVersion": "8.0.100", - "nextChannel": "8.0.1xx-rc2", + "nextChannel": "8.0.1xx", "azureFeed": "", - "sdkImageOverride": "8.0.100-rc.2.23502.2" + "sdkImageOverride": "8.0.100-rtm.23551.15" }, "internalfeed": { "url": "" diff --git a/global.json b/global.json index 3ecc5db745d..5ce84955149 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.100-rc.2.23502.2" + "version": "8.0.100" } } diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj index 1e7f70bc8f8..1281bac664b 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj @@ -8,7 +8,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 0d6c585478d..a4e24bf8be9 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 4e4995c36d4..96b8c6d3018 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -33,8 +33,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 3c00ae295b8..be5619b5dda 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 749e916eab5..c6e8bf10326 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -19,9 +19,9 @@ - - - + + + - +
diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index 084ba8e2ffe..b57908f94a6 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 6a81d5053b8..e1fbfce6894 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -34,16 +34,16 @@ - - - - + + + + - - - - - + + + + + diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index 4d4aea1f0aa..14b4b3adf3a 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -1321,7 +1321,7 @@ class InheritedClassTest : System.Attribute Context "Cmdlet name completion" { BeforeAll { $testCases = @( - @{ inputStr = "get-c*item"; expected = "Get-ChildItem" } + @{ inputStr = "get-ch*item"; expected = "Get-ChildItem" } @{ inputStr = "set-alia?"; expected = "Set-Alias" } @{ inputStr = "s*-alias"; expected = "Set-Alias" } @{ inputStr = "se*-alias"; expected = "Set-Alias" } @@ -2012,7 +2012,7 @@ dir -Recurse ` } It "Test complete module file name" { - $inputStr = "using module test" + $inputStr = "using module testm" $res = TabExpansion2 -inputScript $inputStr -cursorColumn $inputStr.Length $res.CompletionMatches | Should -HaveCount 1 $res.CompletionMatches[0].CompletionText | Should -BeExactly ".${separator}testModule.psm1" diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index ed5011fdc19..cca4de650bc 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 3d9d5a4eda6..b742b0f6566 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/tools/releaseBuild/azureDevOps/templates/nuget-pkg-sbom.yml b/tools/releaseBuild/azureDevOps/templates/nuget-pkg-sbom.yml index 276ab1511cd..c8d1a9b835b 100644 --- a/tools/releaseBuild/azureDevOps/templates/nuget-pkg-sbom.yml +++ b/tools/releaseBuild/azureDevOps/templates/nuget-pkg-sbom.yml @@ -95,7 +95,8 @@ steps: displayName: Build reference assemblies env: - __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) + __DOTNET_RUNTIME_FEED: $(RUNTIME_SOURCEFEED) + __DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY) - ${{ each value in parameters.ListOfFiles }}: - pwsh: | From f5027eda1646ec09aa182f81e1f98b0e2baf7b3a Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 5 Dec 2023 14:52:43 -0800 Subject: [PATCH 0152/1168] Remove RHEL7 publishing to packages.microsoft.com as it's no longer supported (#20849) --- tools/packages.microsoft.com/mapping.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tools/packages.microsoft.com/mapping.json b/tools/packages.microsoft.com/mapping.json index f9d673d5482..d0be6c8e93f 100644 --- a/tools/packages.microsoft.com/mapping.json +++ b/tools/packages.microsoft.com/mapping.json @@ -21,13 +21,6 @@ ], "PackageFormat": "PACKAGE_NAME-POWERSHELL_RELEASE-1.rh.x86_64.rpm" }, - { - "url": "microsoft-rhel7.3-prod", - "distribution": [ - "trusty" - ], - "PackageFormat": "PACKAGE_NAME-POWERSHELL_RELEASE-1.rh.x86_64.rpm" - }, { "url": "cbl-mariner-2.0-prod-Microsoft-aarch64", "distribution": [ From 8957850abd04b736f032286ce33f0e07997897c5 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 5 Dec 2023 18:28:15 -0600 Subject: [PATCH 0153/1168] Expand "iff" to "if-and-only-if" in XML doc content (#20852) --- .../ManagementList/ManagementListStateDescriptor.cs | 2 +- .../commands/management/Service.cs | 8 ++++---- .../host/msh/ConsoleHostUserInterfacePrompt.cs | 4 ++-- .../engine/AutomationEngine.cs | 2 +- src/System.Management.Automation/engine/CoreAdapter.cs | 2 +- .../engine/ICommandRuntime.cs | 8 ++++---- .../engine/MshCommandRuntime.cs | 10 +++++----- src/System.Management.Automation/engine/cmdlet.cs | 8 ++++---- src/System.Management.Automation/engine/pipeline.cs | 2 +- .../namespaces/CoreCommandContext.cs | 8 ++++---- .../singleshell/config/MshSnapinInfo.cs | 9 +++++---- 11 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptor.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptor.cs index 45db449d705..668118a5b7f 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptor.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptor.cs @@ -136,7 +136,7 @@ private static bool VerifyColumnsSavable(ManagementList subject, RetryActionCall /// /// Target ManagementList. /// RetryActionAfterLoaded callback method. - /// True iff columns restorable. + /// True if-and-only-if columns are restorable. /// /// ManagementList.AutoGenerateColumns not supported. /// diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs index ec6e8062dd0..b46f21dc68c 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs @@ -888,7 +888,7 @@ internal bool DoWaitForStatus( /// This will start the service. /// /// Service to start. - /// True iff the service was started. + /// True if-and-only-if the service was started. internal bool DoStartService(ServiceController serviceController) { Exception exception = null; @@ -944,7 +944,7 @@ internal bool DoStartService(ServiceController serviceController) /// Service to stop. /// Stop dependent services. /// - /// True iff the service was stopped. + /// True if-and-only-if the service was stopped. internal List DoStopService(ServiceController serviceController, bool force, bool waitForServiceToStop) { // Ignore ServiceController.CanStop. CanStop will be set false @@ -1094,7 +1094,7 @@ internal void RemoveNotStoppedServices(List services) /// This will pause the service. /// /// Service to pause. - /// True iff the service was paused. + /// True if-and-only-if the service was paused. internal bool DoPauseService(ServiceController serviceController) { Exception exception = null; @@ -1174,7 +1174,7 @@ internal bool DoPauseService(ServiceController serviceController) /// This will resume the service. /// /// Service to resume. - /// True iff the service was resumed. + /// True if-and-only-if the service was resumed. internal bool DoResumeService(ServiceController serviceController) { Exception exception = null; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs index 7b81bb8a97a..5895dcf2b83 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs @@ -354,7 +354,7 @@ out object convertedObj /// True to echo user input. /// True if the field is a list. /// Valid only if listInput is true. set to true if the input signals end of list input. - /// True iff the input is canceled, e.g., by Ctrl-C or Ctrl-Break. + /// True if-and-only-if the input is canceled, e.g., by Ctrl-C or Ctrl-Break. /// Processed input string to be converted with LanguagePrimitives.ConvertTo. private string PromptReadInput(string fieldPrompt, FieldDescription desc, bool fieldEchoOnPrompt, bool listInput, out bool endListInput, out bool cancelled) @@ -484,7 +484,7 @@ private PromptCommonInputErrors PromptTryConvertTo(Type fieldType, bool isFromRe /// !h prints out field's Quick Help, returns null /// All others tilde comments are invalid and return null /// - /// returns null iff there's nothing the caller can process. + /// returns null if-and-only-if there's nothing the caller can process. /// /// /// diff --git a/src/System.Management.Automation/engine/AutomationEngine.cs b/src/System.Management.Automation/engine/AutomationEngine.cs index cc1ca2f5ad0..592796d5bb0 100644 --- a/src/System.Management.Automation/engine/AutomationEngine.cs +++ b/src/System.Management.Automation/engine/AutomationEngine.cs @@ -86,7 +86,7 @@ internal string Expand(string s) /// Compile a piece of text into a parse tree for later execution. /// /// The text to parse. - /// True iff the scriptblock will be added to history. + /// True if-and-only-if the scriptblock will be added to history. /// The parse text as a parsetree node. internal ScriptBlock ParseScriptBlock(string script, bool addToHistory) { diff --git a/src/System.Management.Automation/engine/CoreAdapter.cs b/src/System.Management.Automation/engine/CoreAdapter.cs index 55486c674ab..980d093f85d 100644 --- a/src/System.Management.Automation/engine/CoreAdapter.cs +++ b/src/System.Management.Automation/engine/CoreAdapter.cs @@ -5440,7 +5440,7 @@ private static object GetNodeObject(XmlNode node) } XmlNodeList nodeChildren = node.ChildNodes; - // nodeChildren will not be null as we already verified iff the node has children. + // nodeChildren will not be null as we already verified that the node has children. if ((nodeChildren.Count == 1) && (nodeChildren[0].NodeType == XmlNodeType.Text)) { return node.InnerText; diff --git a/src/System.Management.Automation/engine/ICommandRuntime.cs b/src/System.Management.Automation/engine/ICommandRuntime.cs index 4fd0c0061b1..49b1104e047 100644 --- a/src/System.Management.Automation/engine/ICommandRuntime.cs +++ b/src/System.Management.Automation/engine/ICommandRuntime.cs @@ -457,11 +457,11 @@ public interface ICommandRuntime /// It may be displayed by some hosts, but not all. /// /// - /// true iff user selects YesToAll. If this is already true, + /// true if-and-only-if user selects YesToAll. If this is already true, /// ShouldContinue will bypass the prompt and return true. /// /// - /// true iff user selects NoToAll. If this is already true, + /// true if-and-only-if user selects NoToAll. If this is already true, /// ShouldContinue will bypass the prompt and return false. /// /// @@ -592,11 +592,11 @@ public interface ICommandRuntime2 : ICommandRuntime /// the default option selected in the selection menu is 'No'. /// /// - /// true iff user selects YesToAll. If this is already true, + /// true if-and-only-if user selects YesToAll. If this is already true, /// ShouldContinue will bypass the prompt and return true. /// /// - /// true iff user selects NoToAll. If this is already true, + /// true if-and-only-if user selects NoToAll. If this is already true, /// ShouldContinue will bypass the prompt and return false. /// /// diff --git a/src/System.Management.Automation/engine/MshCommandRuntime.cs b/src/System.Management.Automation/engine/MshCommandRuntime.cs index 427929c3e8b..9d59d02cb30 100644 --- a/src/System.Management.Automation/engine/MshCommandRuntime.cs +++ b/src/System.Management.Automation/engine/MshCommandRuntime.cs @@ -1483,7 +1483,7 @@ private bool CanShouldProcessAutoConfirm() /// /// are returned. /// - /// true iff the action should be performed + /// true if-and-only-if the action should be performed /// /// The pipeline has already been terminated, or was terminated /// during the execution of this method. @@ -1783,11 +1783,11 @@ public bool ShouldContinue(string query, string caption) /// the default option selected in the selection menu is 'No'. /// /// - /// true iff user selects YesToAll. If this is already true, + /// true if-and-only-if user selects YesToAll. If this is already true, /// ShouldContinue will bypass the prompt and return true. /// /// - /// true iff user selects NoToAll. If this is already true, + /// true if-and-only-if user selects NoToAll. If this is already true, /// ShouldContinue will bypass the prompt and return false. /// /// @@ -1830,11 +1830,11 @@ public bool ShouldContinue( /// It may be displayed by some hosts, but not all. /// /// - /// true iff user selects YesToAll. If this is already true, + /// true if-and-only-if user selects YesToAll. If this is already true, /// ShouldContinue will bypass the prompt and return true. /// /// - /// true iff user selects NoToAll. If this is already true, + /// true if-and-only-if user selects NoToAll. If this is already true, /// ShouldContinue will bypass the prompt and return false. /// /// diff --git a/src/System.Management.Automation/engine/cmdlet.cs b/src/System.Management.Automation/engine/cmdlet.cs index b2b63d364b5..742224c21d5 100644 --- a/src/System.Management.Automation/engine/cmdlet.cs +++ b/src/System.Management.Automation/engine/cmdlet.cs @@ -1311,11 +1311,11 @@ public bool ShouldContinue(string query, string caption) /// It may be displayed by some hosts, but not all. /// /// - /// true iff user selects YesToAll. If this is already true, + /// true if-and-only-if user selects YesToAll. If this is already true, /// ShouldContinue will bypass the prompt and return true. /// /// - /// true iff user selects NoToAll. If this is already true, + /// true if-and-only-if user selects NoToAll. If this is already true, /// ShouldContinue will bypass the prompt and return false. /// /// @@ -1451,11 +1451,11 @@ public bool ShouldContinue( /// the default option selected in the selection menu is 'No'. /// /// - /// true iff user selects YesToAll. If this is already true, + /// true if-and-only-if user selects YesToAll. If this is already true, /// ShouldContinue will bypass the prompt and return true. /// /// - /// true iff user selects NoToAll. If this is already true, + /// true if-and-only-if user selects NoToAll. If this is already true, /// ShouldContinue will bypass the prompt and return false. /// /// diff --git a/src/System.Management.Automation/engine/pipeline.cs b/src/System.Management.Automation/engine/pipeline.cs index e19bf3be843..91bf4359189 100644 --- a/src/System.Management.Automation/engine/pipeline.cs +++ b/src/System.Management.Automation/engine/pipeline.cs @@ -1441,7 +1441,7 @@ private void DisposeCommands() /// /// Error which terminated the pipeline. /// Command against which to log SecondFailure. - /// True iff the pipeline was not already stopped. + /// True if-and-only-if the pipeline was not already stopped. internal bool RecordFailure(Exception e, InternalCommand command) { bool wasStopping = false; diff --git a/src/System.Management.Automation/namespaces/CoreCommandContext.cs b/src/System.Management.Automation/namespaces/CoreCommandContext.cs index 5c62ed6fa98..9ed0e8be95c 100644 --- a/src/System.Management.Automation/namespaces/CoreCommandContext.cs +++ b/src/System.Management.Automation/namespaces/CoreCommandContext.cs @@ -551,7 +551,7 @@ internal SwitchParameter Force /// /// Name of the target resource being acted upon /// - /// true iff the action should be performed + /// true if-and-only-if the action should be performed /// /// The ActionPreference.Stop or ActionPreference.Inquire policy /// triggered a terminating error. The pipeline failure will be @@ -577,7 +577,7 @@ internal bool ShouldProcess( /// Name of the target resource being acted upon /// /// What action was being performed. - /// true iff the action should be performed + /// true if-and-only-if the action should be performed /// /// The ActionPreference.Stop or ActionPreference.Inquire policy /// triggered a terminating error. The pipeline failure will be @@ -616,7 +616,7 @@ internal bool ShouldProcess( /// if the user is prompted whether or not to perform the action. /// It may be displayed by some hosts, but not all. /// - /// true iff the action should be performed + /// true if-and-only-if the action should be performed /// /// The ActionPreference.Stop or ActionPreference.Inquire policy /// triggered a terminating error. The pipeline failure will be @@ -665,7 +665,7 @@ internal bool ShouldProcess( /// /// are returned. /// - /// true iff the action should be performed + /// true if-and-only-if the action should be performed /// /// The ActionPreference.Stop or ActionPreference.Inquire policy /// triggered a terminating error. The pipeline failure will be diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs index 643e649ca7e..df01b053665 100644 --- a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs +++ b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs @@ -407,8 +407,9 @@ internal PSSnapInInfo Clone() } /// - /// Returns true if the PSSnapIn Id is valid. A PSSnapIn is valid iff it contains only - /// "Alpha Numeric","-","_","." characters. + /// Returns true if the PSSnapIn Id is valid. A PSSnapIn is valid + /// if-and-only-if it contains only "Alpha Numeric","-","_","." + /// characters. /// /// PSSnapIn Id to validate. internal static bool IsPSSnapinIdValid(string psSnapinId) @@ -422,8 +423,8 @@ internal static bool IsPSSnapinIdValid(string psSnapinId) } /// - /// Validates the PSSnapIn Id. A PSSnapIn is valid iff it contains only - /// "Alpha Numeric","-","_","." characters. + /// Validates the PSSnapIn Id. A PSSnapIn is valid if-and-only-if it + /// contains only "Alpha Numeric","-","_","." characters. /// /// PSSnapIn Id to validate. /// From 18a2679e4e15175db7e768f13548d6f85e73fb22 Mon Sep 17 00:00:00 2001 From: ImportTaste <53661808+ImportTaste@users.noreply.github.com> Date: Tue, 5 Dec 2023 18:32:10 -0600 Subject: [PATCH 0154/1168] Add the missing alias `LP` to `-LiteralPath` for some cmdlets (#20820) --- src/Microsoft.PowerShell.Security/security/AclCommands.cs | 4 ++-- .../security/CertificateCommands.cs | 2 +- .../security/SignatureCommands.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.PowerShell.Security/security/AclCommands.cs b/src/Microsoft.PowerShell.Security/security/AclCommands.cs index 829df70d255..1b5beffa49e 100644 --- a/src/Microsoft.PowerShell.Security/security/AclCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/AclCommands.cs @@ -662,7 +662,7 @@ public PSObject InputObject /// security descriptor. Default is the current location. /// [Parameter(ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "ByLiteralPath")] - [Alias("PSPath")] + [Alias("PSPath", "LP")] [ValidateNotNullOrEmpty] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] LiteralPath @@ -929,7 +929,7 @@ public PSObject InputObject /// security descriptor. /// [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "ByLiteralPath")] - [Alias("PSPath")] + [Alias("PSPath", "LP")] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] LiteralPath { diff --git a/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs b/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs index 4723aa7fbf0..4d65d628ad3 100644 --- a/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs @@ -44,7 +44,7 @@ public string[] FilePath /// certificate. /// [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true, ParameterSetName = "ByLiteralPath")] - [Alias("PSPath")] + [Alias("PSPath", "LP")] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] LiteralPath { diff --git a/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs b/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs index 581266d3ad9..53a662ca4f9 100644 --- a/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs @@ -44,7 +44,7 @@ public string[] FilePath /// digital signature. /// [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "ByLiteralPath")] - [Alias("PSPath")] + [Alias("PSPath", "LP")] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] LiteralPath { From 9f748876becdf015405c13a2cf6316360b29afa3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:37:19 -0800 Subject: [PATCH 0155/1168] Bump actions/github-script from 6 to 7 (#20682) --- .github/workflows/rebase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index faf5ddda535..d04ac792da3 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -22,7 +22,7 @@ jobs: with: fetch-depth: 0 - name: Post rebase started comment to pull request - uses: actions/github-script@v6 + uses: actions/github-script@v7 continue-on-error: true with: script: | From 9f8d0c4d96494506e05276b55227ce358cb81010 Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Wed, 6 Dec 2023 09:44:06 +0900 Subject: [PATCH 0156/1168] Fix a typo in `InputFieldBackgroundTextConverter.cs` (#20838) --- .../FilterProviders/InputFieldBackgroundTextConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/InputFieldBackgroundTextConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/InputFieldBackgroundTextConverter.cs index 28adfa82c86..1295b933d5b 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/InputFieldBackgroundTextConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/InputFieldBackgroundTextConverter.cs @@ -11,7 +11,7 @@ namespace Microsoft.Management.UI.Internal { /// - /// The InputFieldBackgroundTextConverter is responsible for determing the + /// The InputFieldBackgroundTextConverter is responsible for determining the /// correct background text to display for a particular type of data. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] From 7f0fbfddfc4a59af0a95494f74331d1577a360ed Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Wed, 6 Dec 2023 10:53:56 -0800 Subject: [PATCH 0157/1168] Sign the global tool shim exe (#20794) --- tools/releaseBuild/signing.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/releaseBuild/signing.xml b/tools/releaseBuild/signing.xml index 11f63fe69cc..a6b19f6a07a 100644 --- a/tools/releaseBuild/signing.xml +++ b/tools/releaseBuild/signing.xml @@ -21,6 +21,8 @@ + + From 40b88dd0bcc04c195a58643837d58be5d838b5f3 Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Wed, 6 Dec 2023 11:03:25 -0800 Subject: [PATCH 0158/1168] Update the cgmanifest (#20764) --- tools/cgmanifest.json | 90 +++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index eae3f77df33..ff5ad871cf4 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { @@ -55,7 +56,7 @@ "Type": "nuget", "Nuget": { "Name": "JsonSchema.Net", - "Version": "5.2.6" + "Version": "5.4.0" } }, "DevelopmentDependency": false @@ -105,7 +106,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.CodeAnalysis.Common", - "Version": "4.7.0" + "Version": "4.8.0" } }, "DevelopmentDependency": false @@ -115,7 +116,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.CodeAnalysis.CSharp", - "Version": "4.7.0" + "Version": "4.8.0" } }, "DevelopmentDependency": false @@ -195,7 +196,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.Win32.Registry.AccessControl", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -215,7 +216,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.Win32.SystemEvents", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -225,7 +226,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.Windows.Compatibility", - "Version": "7.0.5" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -245,7 +246,7 @@ "Type": "nuget", "Nuget": { "Name": "runtime.linux-arm.runtime.native.System.IO.Ports", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -255,7 +256,7 @@ "Type": "nuget", "Nuget": { "Name": "runtime.linux-arm64.runtime.native.System.IO.Ports", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -265,7 +266,7 @@ "Type": "nuget", "Nuget": { "Name": "runtime.linux-x64.runtime.native.System.IO.Ports", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -285,7 +286,7 @@ "Type": "nuget", "Nuget": { "Name": "runtime.native.System.IO.Ports", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -295,7 +296,7 @@ "Type": "nuget", "Nuget": { "Name": "runtime.osx-arm64.runtime.native.System.IO.Ports", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -305,7 +306,7 @@ "Type": "nuget", "Nuget": { "Name": "runtime.osx-x64.runtime.native.System.IO.Ports", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -365,7 +366,7 @@ "Type": "nuget", "Nuget": { "Name": "System.CodeDom", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -385,7 +386,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ComponentModel.Composition.Registration", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -395,7 +396,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ComponentModel.Composition", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -405,7 +406,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Configuration.ConfigurationManager", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -415,7 +416,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Data.Odbc", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -425,7 +426,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Data.OleDb", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -445,7 +446,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Diagnostics.DiagnosticSource", - "Version": "7.0.2" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -455,7 +456,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Diagnostics.EventLog", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -465,7 +466,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Diagnostics.PerformanceCounter", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -475,7 +476,7 @@ "Type": "nuget", "Nuget": { "Name": "System.DirectoryServices.AccountManagement", - "Version": "7.0.1" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -485,7 +486,7 @@ "Type": "nuget", "Nuget": { "Name": "System.DirectoryServices.Protocols", - "Version": "7.0.1" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -495,7 +496,7 @@ "Type": "nuget", "Nuget": { "Name": "System.DirectoryServices", - "Version": "7.0.1" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -505,7 +506,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Drawing.Common", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -515,7 +516,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Formats.Asn1", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -525,7 +526,7 @@ "Type": "nuget", "Nuget": { "Name": "System.IO.Packaging", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -535,7 +536,7 @@ "Type": "nuget", "Nuget": { "Name": "System.IO.Ports", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -545,7 +546,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Management", - "Version": "7.0.2" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -555,7 +556,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Net.Http.WinHttpHandler", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -585,7 +586,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Reflection.Context", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -615,7 +616,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Runtime.Caching", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -645,7 +646,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Security.Cryptography.Pkcs", - "Version": "7.0.3" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -655,7 +656,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Security.Cryptography.ProtectedData", - "Version": "7.0.1" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -665,7 +666,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Security.Cryptography.Xml", - "Version": "7.0.1" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -675,7 +676,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Security.Permissions", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -745,7 +746,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ServiceModel.Syndication", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -755,7 +756,7 @@ "Type": "nuget", "Nuget": { "Name": "System.ServiceProcess.ServiceController", - "Version": "7.0.1" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -765,7 +766,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Speech", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -775,7 +776,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Text.Encoding.CodePages", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -785,7 +786,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Text.Encodings.Web", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -805,7 +806,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Threading.AccessControl", - "Version": "7.0.1" + "Version": "8.0.0" } }, "DevelopmentDependency": false @@ -825,11 +826,10 @@ "Type": "nuget", "Nuget": { "Name": "System.Windows.Extensions", - "Version": "7.0.0" + "Version": "8.0.0" } }, "DevelopmentDependency": false } - ], - "$schema": "https://json.schemastore.org/component-detection-manifest.json" + ] } From 9489629f769061e3ff40f155fd2ce9a0a6c4334a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 11:12:54 -0800 Subject: [PATCH 0159/1168] Bump xunit.runner.visualstudio from 2.5.3 to 2.5.4 (#20729) --- 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 a5ecd4e5296..97f82feca2b 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -25,7 +25,7 @@ - + From 8c888726a5aed973da3849b88a032645655c71a2 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 7 Dec 2023 11:04:20 -0800 Subject: [PATCH 0160/1168] Set the `ollForwardOnNoCandidateFx` in `runtimeconfig.json` to roll forward only on minor and patch versions (#20689) --- .../runtimeconfig.template.json | 4 ++-- src/powershell-unix/runtimeconfig.template.json | 3 ++- src/powershell-win-core/runtimeconfig.template.json | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.PowerShell.GlobalTool.Shim/runtimeconfig.template.json b/src/Microsoft.PowerShell.GlobalTool.Shim/runtimeconfig.template.json index 8ba6dc2eba9..4a5e3e367ec 100644 --- a/src/Microsoft.PowerShell.GlobalTool.Shim/runtimeconfig.template.json +++ b/src/Microsoft.PowerShell.GlobalTool.Shim/runtimeconfig.template.json @@ -1,4 +1,4 @@ -// This is required to roll forward to runtime 3.x when 2.x is not installed +// This is required to roll forward to supported minor.patch versions of the runtime. { - "rollForwardOnNoCandidateFx": 2 + "rollForwardOnNoCandidateFx": 1 } diff --git a/src/powershell-unix/runtimeconfig.template.json b/src/powershell-unix/runtimeconfig.template.json index a3075303ad5..4a5e3e367ec 100644 --- a/src/powershell-unix/runtimeconfig.template.json +++ b/src/powershell-unix/runtimeconfig.template.json @@ -1,3 +1,4 @@ +// This is required to roll forward to supported minor.patch versions of the runtime. { - "rollForwardOnNoCandidateFx": 2 + "rollForwardOnNoCandidateFx": 1 } diff --git a/src/powershell-win-core/runtimeconfig.template.json b/src/powershell-win-core/runtimeconfig.template.json index a3075303ad5..4a5e3e367ec 100644 --- a/src/powershell-win-core/runtimeconfig.template.json +++ b/src/powershell-win-core/runtimeconfig.template.json @@ -1,3 +1,4 @@ +// This is required to roll forward to supported minor.patch versions of the runtime. { - "rollForwardOnNoCandidateFx": 2 + "rollForwardOnNoCandidateFx": 1 } From 0c5123ceea1818dec80a1a6ac6bcf6ab3c8fecbb Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 7 Dec 2023 11:06:43 -0800 Subject: [PATCH 0161/1168] Update `apiscan.yml` to have access to the `AzDevOpsArtifacts` variable group (#20671) --- .../azureDevOps/templates/compliance/apiscan.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml index 76ef145886f..b9d497a9053 100644 --- a/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml +++ b/tools/releaseBuild/azureDevOps/templates/compliance/apiscan.yml @@ -19,6 +19,7 @@ jobs: - group: DotNetPrivateBuildAccess - group: Azure Blob variable group - group: ReleasePipelineSecrets + - group: AzDevOpsArtifacts pool: name: PowerShell1ES @@ -35,11 +36,9 @@ jobs: CreateJson: yes UseJson: no - - template: ../cloneToOfficialPath.yml - - template: ../insert-nuget-config-azfeed.yml parameters: - repoRoot: $(PowerShellRoot) + repoRoot: '$(Build.SourcesDirectory)' - pwsh: | Import-Module .\build.psm1 -force From 3eda139723ee78825232c61f0c981d708e0f7c9d Mon Sep 17 00:00:00 2001 From: Chaz Beck Date: Thu, 7 Dec 2023 11:11:28 -0800 Subject: [PATCH 0162/1168] Fix `Start-Process -PassThru` to make sure the `ExitCode` property is accessible for the returned `Process` object (#20749) --- .../commands/management/Process.cs | 7 +++++++ .../Start-Process.Tests.ps1 | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs index c5df76c0445..e445b60986e 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs @@ -2126,6 +2126,13 @@ protected override void BeginProcessing() jobAssigned = jobObject.AssignProcessToJobObject(processInfo.Process); } + // Since the process wasn't spawned by .NET, we need to trigger .NET to get a lock on the handle of the process. + // Otherwise, accessing properties like `ExitCode` will throw the following exception: + // "Process was not started by this object, so requested information cannot be determined." + // Fetching the process handle will trigger the `Process` object to update its internal state by calling `SetProcessHandle`, + // the result is discarded as it's not used later in this code. + _ = process.Handle; + // Resume the process now that is has been set up. processInfo.Resume(); #endif 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 30bc1e676dc..50cde0bae6e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Start-Process.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Start-Process.Tests.ps1 @@ -115,6 +115,11 @@ Describe "Start-Process" -Tag "Feature","RequireAdminOnWindows" { { Start-Process -FilePath $pingCommand -NoNewWindow -WindowStyle Normal -ErrorAction Stop } | Should -Throw -ErrorId "InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand" } + It "ExitCode returns with -NoNewWindow, -PassThru and -Wait" { + $process = Start-Process -FilePath $pingCommand -ArgumentList $pingParam -NoNewWindow -PassThru -Wait -ErrorAction Stop + $process.ExitCode | Should -Be 0 + } + It "Should start cmd.exe with Verb 'open' and WindowStyle 'Minimized'" -Skip:(!$isFullWin) { $fileToWrite = Join-Path $TestDrive "VerbTest.txt" $process = Start-Process cmd.exe -ArgumentList "/c echo abc > $fileToWrite" -Verb open -WindowStyle Minimized -PassThru From a1ef78dbec466e7eca7e748a422600a8d9006c4f Mon Sep 17 00:00:00 2001 From: Steven Bucher Date: Fri, 8 Dec 2023 12:19:05 -0800 Subject: [PATCH 0163/1168] Bot refactoring for easier use and updating (#20805) --- .../IssueManagement.CloseResolutions.yml | 137 ++++++ .../IssueManagement.IssueFeedbackForm.yml | 22 + .../policies/IssueManagement.ResolveStale.yml | 107 +++++ .github/policies/PRManagement.yml | 226 ++++++++++ .github/policies/resourceManagement.yml | 420 ------------------ 5 files changed, 492 insertions(+), 420 deletions(-) create mode 100644 .github/policies/IssueManagement.CloseResolutions.yml create mode 100644 .github/policies/IssueManagement.IssueFeedbackForm.yml create mode 100644 .github/policies/IssueManagement.ResolveStale.yml create mode 100644 .github/policies/PRManagement.yml delete mode 100644 .github/policies/resourceManagement.yml diff --git a/.github/policies/IssueManagement.CloseResolutions.yml b/.github/policies/IssueManagement.CloseResolutions.yml new file mode 100644 index 00000000000..23ab9422e1a --- /dev/null +++ b/.github/policies/IssueManagement.CloseResolutions.yml @@ -0,0 +1,137 @@ +id: CloseResolutionTags +name: GitOps.PullRequestIssueManagement +description: Closing issues with Resolution* +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + scheduledSearches: + - description: Close if marked as Resolution-Declined after one day of no activity + frequencies: + - hourly: + hour: 12 + filters: + - isIssue + - isOpen + - hasLabel: + label: Resolution-Declined + - noActivitySince: + days: 1 + actions: + - addReply: + reply: This issue has been marked as declined and has not had any activity for **1 day**. It has been closed for housekeeping purposes. + - closeIssue + + - description: Close if marked as Resolution-By Design after one day of no activity + frequencies: + - hourly: + hour: 12 + filters: + - isIssue + - isOpen + - hasLabel: + label: Resolution-By Design + - noActivitySince: + days: 1 + actions: + - addReply: + reply: This issue has been marked as by-design and has not had any activity for **1 day**. It has been closed for housekeeping purposes. + - closeIssue + + - description: Close if marked as Resolution-Won't Fix after one day of no activity + frequencies: + - hourly: + hour: 12 + filters: + - isIssue + - isOpen + - hasLabel: + label: Resolution-Won't Fix + - noActivitySince: + days: 1 + actions: + - addReply: + reply: This issue has been marked as won't fix and has not had any activity for **1 day**. It has been closed for housekeeping purposes. + - closeIssue + + - description: Close if marked as Resolution-No Activity after seven day of no activity, no reply + frequencies: + - hourly: + hour: 12 + filters: + - isOpen + - isIssue + - hasLabel: + label: Resolution-No Activity + - noActivitySince: + days: 7 + actions: + - closeIssue + + - description: Close if marked as Resolution-Duplicate after one day of no activity + frequencies: + - hourly: + hour: 3 + filters: + - isIssue + - isOpen + - hasLabel: + label: Resolution-Duplicate + - noActivitySince: + days: 1 + actions: + - addReply: + reply: This issue has been marked as duplicate and has not had any activity for **1 day**. It has been closed for housekeeping purposes. + - closeIssue + + - description: Close if marked as Resolution-External after one day of no activity + frequencies: + - hourly: + hour: 3 + filters: + - isIssue + - isOpen + - hasLabel: + label: Resolution-External + - noActivitySince: + days: 1 + actions: + - addReply: + reply: This issue has been marked as external and has not had any activity for **1 day**. It has been be closed for housekeeping purposes. + - closeIssue + + - description: Close if marked as Resolution-Answered after one day of no activity + frequencies: + - hourly: + hour: 12 + filters: + - isIssue + - isOpen + - hasLabel: + label: Resolution-Answered + - noActivitySince: + days: 1 + actions: + - addReply: + reply: This issue has been marked as answered and has not had any activity for **1 day**. It has been closed for housekeeping purposes. + - closeIssue + + - description: Close if marked as Resolution-Fixed after one day of no activity + frequencies: + - hourly: + hour: 12 + filters: + - isIssue + - isOpen + - hasLabel: + label: Resolution-Fixed + - noActivitySince: + days: 1 + actions: + - addReply: + reply: This issue has been marked as fixed and has not had any activity for **1 day**. It has been closed for housekeeping purposes. + - closeIssue +onFailure: +onSuccess: diff --git a/.github/policies/IssueManagement.IssueFeedbackForm.yml b/.github/policies/IssueManagement.IssueFeedbackForm.yml new file mode 100644 index 00000000000..9f1986d2e4a --- /dev/null +++ b/.github/policies/IssueManagement.IssueFeedbackForm.yml @@ -0,0 +1,22 @@ +id: IssueManagement.IssueFeedbackForm +name: GitOps.PullRequestIssueManagement +description: Bot to request the feedback for how we are doing in the repo, replies on closed PRs and issues that are NOT labeled with no activity +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + eventResponderTasks: + - if: + - not: + hasLabel: + label: Resolution-No Activity + - isAction: + action: Closed + then: + - addReply: + reply: " 📣 Hey @${issueAuthor}, how did we do? We would love to hear your feedback with the link below! 🗣️ \n\n🔗 aka.ms/PSRepoFeedback " + triggerOnOwnActions: true +onFailure: +onSuccess: diff --git a/.github/policies/IssueManagement.ResolveStale.yml b/.github/policies/IssueManagement.ResolveStale.yml new file mode 100644 index 00000000000..2994a2e38e8 --- /dev/null +++ b/.github/policies/IssueManagement.ResolveStale.yml @@ -0,0 +1,107 @@ +id: IssueManagement.ResolveStale +name: GitOps.PullRequestIssueManagement +description: Other issue management rules for closing stale and waiting on author requests +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + scheduledSearches: + - description: Close if marked as Waiting on Author and no activity in 7 days + frequencies: + - hourly: + hour: 12 + filters: + - isOpen + - isIssue + - hasLabel: + label: Waiting on Author + - noActivitySince: + days: 7 + actions: + - addReply: + reply: This issue has been marked as "Waiting on Author" and has not had any activity for **7 day**. It has been closed for housekeeping purposes. + - closeIssue + + - description: Label as Resolution-No Activity if not labeled with KeepOpen and no activity in 6 months + frequencies: + - hourly: + hour: 24 + filters: + - isIssue + - isOpen + - isNotLabeledWith: + label: KeepOpen + - isNotLabeledWith: + label: Needs-Triage + - isNotLabeledWith: + label: Resolution-No Activity + - isNotLabeledWith: + label: Issue-Meta + - isNotLabeledWith: + label: Review - Needed + - isNotLabeledWith: + label: Review - Committee + - isNotLabeledWith: + label: Review - Maintainer + - isNotLabeledWith: + label: WG-NeedsReview + # Up for grabs labeled issues will get closed after a 6 months of no activity unless KeepOpen label is included + - noActivitySince: + days: 180 + actions: + - addLabel: + label: Resolution-No Activity + - addReply: + reply: "This issue has not had any activity in 6 months, if there is no further activity in 7 days, the issue will be closed automatically.\n\nActivity in this case refers only to comments on the issue. If the issue is closed and you are the author, you can re-open the issue using the button below. Please add more information to be considered during retriage. If you are not the author but the issue is impacting you after it has been closed, please submit a new issue with updated details and a link to this issue and the original." + eventResponderTasks: + - description: Remove no resolution label if anyone comments while in 7 day window + if: + - payloadType: Issue_Comment + - hasLabel: + label: Resolution-No Activity + - isOpen + then: + - removeLabel: + label: Resolution-No Activity + + - description: If new issue comment is author then remove waiting on author + if: + - payloadType: Issue_Comment + - isActivitySender: + issueAuthor: True + - hasLabel: + label: Waiting on Author + then: + - removeLabel: + label: Waiting on Author + + - description: Remove Stale label if issue comment + if: + - payloadType: Issue_Comment + - hasLabel: + label: Stale + then: + - removeLabel: + label: Stale + + - description: Remove Needs-Triage label if issue is closed + if: + - payloadType: Issues + - isAction: + action: Closed + then: + - removeLabel: + label: Needs-Triage + + - description: Remove Keep Open label if closed by someone + if: + - payloadType: Issues + - isAction: + action: Closed + then: + - removeLabel: + label: KeepOpen +onFailure: +onSuccess: diff --git a/.github/policies/PRManagement.yml b/.github/policies/PRManagement.yml new file mode 100644 index 00000000000..9deaf0262bb --- /dev/null +++ b/.github/policies/PRManagement.yml @@ -0,0 +1,226 @@ +id: PRManagement +name: GitOps.PullRequestIssueManagement +description: Collection of PR bot triaging behaviors +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + scheduledSearches: + - description: If Stale label and waiting on author and no activity since 10 days then close the PR + frequencies: + - hourly: + hour: 12 + filters: + - isPullRequest + - isOpen + - hasLabel: + label: Waiting on Author + - hasLabel: + label: Stale + - noActivitySince: + days: 10 + actions: + - closeIssue + + - description: If PR has Waiting on Author label and no activity in 15 days label as stale. + frequencies: + - hourly: + hour: 3 + filters: + - isPullRequest + - isOpen + - hasLabel: + label: Waiting on Author + - noActivitySince: + days: 15 + - isNotLabeledWith: + label: Stale + actions: + - addLabel: + label: Stale + - addReply: + reply: This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **15 days**. It will be closed if no further activity occurs **within 10 days of this comment**. + + - description: Label Review - Needed if PR is opened an no activity in 7 days but no other labels on it + frequencies: + - hourly: + hour: 12 + filters: + - isPullRequest + - isOpen + - isNotLabeledWith: + label: Waiting on Author + - noActivitySince: + days: 7 + - isNotLabeledWith: + label: Stale + - isNotLabeledWith: + label: Review - Needed + - isNotLabeledWith: + label: Review - Committee + - isNotDraftPullRequest + actions: + - addLabel: + label: Review - Needed + - addReply: + reply: >- + This pull request has been automatically marked as Review Needed because it has been there has not been any activity for **7 days**. + + Maintainer, please provide feedback and/or mark it as `Waiting on Author` + + - description: Add waiting on Author label if is draft PR, if no activity label + frequencies: + - hourly: + hour: 12 + filters: + - isOpen + - isDraftPullRequest + - isNotLabeledWith: + label: Review - Committee + - isNotLabeledWith: + label: Waiting on Author + - isNotLabeledWith: + label: Stale + - noActivitySince: + days: 3 + actions: + - addLabel: + label: Waiting on Author + eventResponderTasks: + + - description: If PR has AutoMerge Label then enable Automerge to squash + if: + - payloadType: Pull_Request + - hasLabel: + label: AutoMerge + then: + - enableAutoMerge: + mergeMethod: Squash + + - description: If PR has label AutoMerge Removed then disable Automerge + if: + - payloadType: Pull_Request + - labelRemoved: + label: AutoMerge + then: + - disableAutoMerge + + - description: If PR review requests changes then add label waiting on Author and remove review needed + if: + - payloadType: Pull_Request_Review + - isAction: + action: Submitted + - isReviewState: + reviewState: Changes_requested + then: + - addLabel: + label: Waiting on Author + - removeLabel: + label: Review - Needed + + - description: Remove Waiting on author if has label and activity from author + if: + - payloadType: Pull_Request + - isActivitySender: + issueAuthor: True + - not: + isAction: + action: Closed + - hasLabel: + label: Waiting on Author + - not: + titleContains: + pattern: "(WIP|Work in progress|\U0001F6A7)" + isRegex: True + then: + - removeLabel: + label: Waiting on Author + + - description: remove waiting on author if review by author and has waiting on author + if: + - payloadType: Pull_Request_Review + - isActivitySender: + issueAuthor: True + - hasLabel: + label: Waiting on Author + then: + - removeLabel: + label: Waiting on Author + + - description: Remove Stale label if PR has activity from author which is not closure + if: + - payloadType: Pull_Request + - not: + isAction: + action: Closed + - hasLabel: + label: Stale + - isActivitySender: + issueAuthor: True + then: + - removeLabel: + label: Stale + + - description: Remove Stale label if PR is reviewed + if: + - payloadType: Pull_Request_Review + - hasLabel: + label: Stale + then: + - removeLabel: + label: Stale + + - description: Remove Review Needed if PR is created or done any action by Admins and iSazonov + if: + - payloadType: Pull_Request + - hasLabel: + label: Review - Needed + - or: + - isAction: + action: Null + - isAction: + action: Closed + - isAction: + action: Reopened + - isAction: + action: Assigned + - isAction: + action: Unassigned + - isAction: + action: Unlabeled + - or: + - activitySenderHasPermission: + permission: Admin + - isActivitySender: + user: iSazonov + issueAuthor: False + then: + - removeLabel: + label: Review - Needed + + - description: Remove Review - Needed if issue comment is by admin or iSazonov + if: + - payloadType: Issue_Comment + - hasLabel: + label: Review - Needed + - or: + - activitySenderHasPermission: + permission: Admin + - isActivitySender: + user: iSazonov + issueAuthor: False + then: + - removeLabel: + label: Review - Needed + + - description: If inPRLabel then label in PR + if: + - payloadType: Pull_Request + then: + - inPrLabel: + label: In-PR + +onFailure: +onSuccess: diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml deleted file mode 100644 index f00f61c243d..00000000000 --- a/.github/policies/resourceManagement.yml +++ /dev/null @@ -1,420 +0,0 @@ -id: -name: GitOps.PullRequestIssueManagement -description: GitOps.PullRequestIssueManagement primitive -owner: -resource: repository -disabled: false -where: -configuration: - resourceManagementConfiguration: - scheduledSearches: - - description: - frequencies: - - hourly: - hour: 12 - filters: - - isPullRequest - - isOpen - - hasLabel: - label: Waiting on Author - - hasLabel: - label: Stale - - noActivitySince: - days: 10 - actions: - - closeIssue - - description: - frequencies: - - hourly: - hour: 3 - filters: - - isPullRequest - - isOpen - - hasLabel: - label: Waiting on Author - - noActivitySince: - days: 15 - - isNotLabeledWith: - label: Stale - actions: - - addLabel: - label: Stale - - addReply: - reply: This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **15 days**. It will be closed if no further activity occurs **within 10 days of this comment**. - - description: - frequencies: - - hourly: - hour: 3 - filters: - - isIssue - - isOpen - - hasLabel: - label: Resolution-Duplicate - - noActivitySince: - days: 1 - actions: - - addReply: - reply: This issue has been marked as duplicate and has not had any activity for **1 day**. It has been closed for housekeeping purposes. - - closeIssue - - description: - frequencies: - - hourly: - hour: 3 - filters: - - isIssue - - isOpen - - hasLabel: - label: Resolution-External - - noActivitySince: - days: 1 - actions: - - addReply: - reply: This issue has been marked as external and has not had any activity for **1 day**. It has been be closed for housekeeping purposes. - - closeIssue - - description: - frequencies: - - hourly: - hour: 12 - filters: - - isIssue - - isOpen - - hasLabel: - label: Resolution-Answered - - noActivitySince: - days: 1 - actions: - - addReply: - reply: This issue has been marked as answered and has not had any activity for **1 day**. It has been closed for housekeeping purposes. - - closeIssue - - description: - frequencies: - - hourly: - hour: 12 - filters: - - isIssue - - isOpen - - hasLabel: - label: Resolution-Fixed - - noActivitySince: - days: 1 - actions: - - addReply: - reply: This issue has been marked as fixed and has not had any activity for **1 day**. It has been closed for housekeeping purposes. - - closeIssue - - description: - frequencies: - - hourly: - hour: 12 - filters: - - isPullRequest - - isOpen - - isNotLabeledWith: - label: Waiting on Author - - noActivitySince: - days: 7 - - isNotLabeledWith: - label: Stale - - isNotLabeledWith: - label: Review - Needed - - isNotLabeledWith: - label: Review - Committee - - isNotDraftPullRequest - actions: - - addLabel: - label: Review - Needed - - addReply: - reply: >- - This pull request has been automatically marked as Review Needed because it has been there has not been any activity for **7 days**. - - Maintainer, please provide feedback and/or mark it as `Waiting on Author` - - description: - frequencies: - - hourly: - hour: 12 - filters: - - isOpen - - isDraftPullRequest - - isNotLabeledWith: - label: Review - Committee - - isNotLabeledWith: - label: Waiting on Author - - isNotLabeledWith: - label: Stale - - noActivitySince: - days: 3 - actions: - - addLabel: - label: Waiting on Author - - description: - frequencies: - - hourly: - hour: 12 - filters: - - isIssue - - isOpen - - hasLabel: - label: Resolution-Declined - - noActivitySince: - days: 1 - actions: - - addReply: - reply: This issue has been marked as declined and has not had any activity for **1 day**. It has been closed for housekeeping purposes. - - closeIssue - - description: - frequencies: - - hourly: - hour: 12 - filters: - - isIssue - - isOpen - - hasLabel: - label: Resolution-By Design - - noActivitySince: - days: 1 - actions: - - addReply: - reply: This issue has been marked as by-design and has not had any activity for **1 day**. It has been closed for housekeeping purposes. - - closeIssue - - description: - frequencies: - - hourly: - hour: 12 - filters: - - isIssue - - isOpen - - hasLabel: - label: Resolution-Won't Fix - - noActivitySince: - days: 1 - actions: - - addReply: - reply: This issue has been marked as won't fix and has not had any activity for **1 day**. It has been closed for housekeeping purposes. - - closeIssue - - description: - frequencies: - - hourly: - hour: 12 - filters: - - isOpen - - isIssue - - hasLabel: - label: Waiting on Author - - noActivitySince: - days: 7 - actions: - - addReply: - reply: This issue has been marked as "Waiting on Author" and has not had any activity for **7 day**. It has been closed for housekeeping purposes. - - closeIssue - - description: Resolution no activity - frequencies: - - hourly: - hour: 12 - filters: - - isOpen - - isIssue - - hasLabel: - label: Resolution-No Activity - - noActivitySince: - days: 7 - actions: - - addReply: - reply: This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes. - - closeIssue - - description: This is for closing issues that have no activity for 6 months. - frequencies: - - hourly: - hour: 24 - filters: - - isIssue - - isOpen - - isNotLabeledWith: - label: KeepOpen - - isNotLabeledWith: - label: Resolution-No Activity - - noActivitySince: - days: 180 - actions: - - addReply: - reply: This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. - - addLabel: - label: Resolution-No Activity - eventResponderTasks: - - if: - - payloadType: Issue_Comment - - hasLabel: - label: Resolution-No Activity - then: - - removeLabel: - label: Resolution-No Activity - description: Remove resolution no activity label when anyone comments on an issue with the label. - - if: - - payloadType: Pull_Request - - hasLabel: - label: AutoMerge - then: - - enableAutoMerge: - mergeMethod: Squash - description: - - if: - - payloadType: Pull_Request - - labelRemoved: - label: AutoMerge - then: - - disableAutoMerge - description: - - if: - - payloadType: Pull_Request_Review - - isAction: - action: Submitted - - isReviewState: - reviewState: Changes_requested - then: - - addLabel: - label: Waiting on Author - - removeLabel: - label: Review - Needed - description: - - if: - - payloadType: Pull_Request - - isActivitySender: - issueAuthor: True - - not: - isAction: - action: Closed - - hasLabel: - label: Waiting on Author - - not: - titleContains: - pattern: "(WIP|Work in progress|\U0001F6A7)" - isRegex: True - then: - - removeLabel: - label: Waiting on Author - description: - - if: - - payloadType: Issue_Comment - - isActivitySender: - issueAuthor: True - - hasLabel: - label: Waiting on Author - then: - - removeLabel: - label: Waiting on Author - description: - - if: - - payloadType: Pull_Request_Review - - isActivitySender: - issueAuthor: True - - hasLabel: - label: Waiting on Author - then: - - removeLabel: - label: Waiting on Author - - if: - - payloadType: Pull_Request - - not: - isAction: - action: Closed - - hasLabel: - label: Stale - - isActivitySender: - issueAuthor: True - then: - - removeLabel: - label: Stale - description: - - if: - - payloadType: Issue_Comment - - hasLabel: - label: Stale - then: - - removeLabel: - label: Stale - description: - - if: - - payloadType: Pull_Request_Review - - hasLabel: - label: Stale - then: - - removeLabel: - label: Stale - description: - - if: - - payloadType: Issue_Comment - then: - - cleanEmailReply - description: - - if: - - payloadType: Pull_Request - - hasLabel: - label: Review - Needed - - or: - - isAction: - action: Null - - isAction: - action: Closed - - isAction: - action: Reopened - - isAction: - action: Assigned - - isAction: - action: Unassigned - - isAction: - action: Unlabeled - - or: - - activitySenderHasPermission: - permission: Admin - - isActivitySender: - user: iSazonov - issueAuthor: False - then: - - removeLabel: - label: Review - Needed - description: - - if: - - payloadType: Issue_Comment - - hasLabel: - label: Review - Needed - - or: - - activitySenderHasPermission: - permission: Admin - - isActivitySender: - user: iSazonov - issueAuthor: False - then: - - removeLabel: - label: Review - Needed - description: - - if: - - payloadType: Issues - - isAction: - action: Closed - then: - - removeLabel: - label: Needs-Triage - description: - - if: - - payloadType: Pull_Request - then: - - inPrLabel: - label: In-PR - description: - - if: - - payloadType: Issue_Comment - - isActivitySender: - issueAuthor: True - - hasLabel: - label: Waiting on Author - then: - - removeLabel: - label: Waiting on Author - description: Automatically commenting for feedback when an issue is closed - triggerOnOwnActions: true - - if: - - isAction: - action: Closed - then: - - addReply: - reply: " 📣 Hey @${issueAuthor}, how did we do? We would love to hear your feedback with the link below! 🗣️ \n\n🔗 https://forms.office.com/r/P926k48jRJ " -onFailure: -onSuccess: From 6a90fd04928a7b56a909b713200009af45a7cc70 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Fri, 8 Dec 2023 12:20:34 -0800 Subject: [PATCH 0164/1168] Leave the input/output/error handles unset when they are not redirected (#20853) --- .../commands/management/Process.cs | 24 +++++++------------ .../WindowsTaskbarJumpList/TaskbarJumpList.cs | 8 +++---- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs index e445b60986e..2dc487d0e33 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs @@ -2421,45 +2421,40 @@ private static byte[] ConvertEnvVarsToByteArray(StringDictionary sd) private void SetStartupInfo(ProcessStartInfo startinfo, ref ProcessNativeMethods.STARTUPINFO lpStartupInfo, ref int creationFlags) { + bool hasRedirection = false; // RedirectionStandardInput if (_redirectstandardinput != null) { + hasRedirection = true; startinfo.RedirectStandardInput = true; _redirectstandardinput = ResolveFilePath(_redirectstandardinput); lpStartupInfo.hStdInput = GetSafeFileHandleForRedirection(_redirectstandardinput, FileMode.Open); } - else - { - lpStartupInfo.hStdInput = new SafeFileHandle(ProcessNativeMethods.GetStdHandle(-10), false); - } // RedirectionStandardOutput if (_redirectstandardoutput != null) { + hasRedirection = true; startinfo.RedirectStandardOutput = true; _redirectstandardoutput = ResolveFilePath(_redirectstandardoutput); lpStartupInfo.hStdOutput = GetSafeFileHandleForRedirection(_redirectstandardoutput, FileMode.Create); } - else - { - lpStartupInfo.hStdOutput = new SafeFileHandle(ProcessNativeMethods.GetStdHandle(-11), false); - } // RedirectionStandardError if (_redirectstandarderror != null) { + hasRedirection = true; startinfo.RedirectStandardError = true; _redirectstandarderror = ResolveFilePath(_redirectstandarderror); lpStartupInfo.hStdError = GetSafeFileHandleForRedirection(_redirectstandarderror, FileMode.Create); } - else + + if (hasRedirection) { - lpStartupInfo.hStdError = new SafeFileHandle(ProcessNativeMethods.GetStdHandle(-12), false); + // Set STARTF_USESTDHANDLES only if there is redirection. + lpStartupInfo.dwFlags = 0x100; } - // STARTF_USESTDHANDLES - lpStartupInfo.dwFlags = 0x100; - if (startinfo.CreateNoWindow) { // No new window: Inherit the parent process's console window @@ -2805,9 +2800,6 @@ internal struct JOBOBJECT_BASIC_PROCESS_ID_LIST internal static class ProcessNativeMethods { - [DllImport(PinvokeDllNames.GetStdHandleDllName, SetLastError = true)] - public static extern IntPtr GetStdHandle(int whichHandle); - [DllImport(PinvokeDllNames.CreateProcessWithLogonWDllName, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static extern bool CreateProcessWithLogonW(string userName, diff --git a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/TaskbarJumpList.cs b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/TaskbarJumpList.cs index 90c6c811bb1..5606eabd567 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/TaskbarJumpList.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/TaskbarJumpList.cs @@ -33,13 +33,12 @@ internal static void CreateRunAsAdministratorJumpList() { try { - TaskbarJumpList.CreateElevatedEntry(ConsoleHostStrings.RunAsAdministrator); + CreateElevatedEntry(ConsoleHostStrings.RunAsAdministrator); } - catch (Exception exception) + catch (Exception) { // Due to COM threading complexity there might still be sporadic failures but they can be // ignored as creating the JumpList is not critical and persists after its first creation. - Debug.Fail($"Creating 'Run as Administrator' JumpList failed. {exception}"); } }); @@ -48,7 +47,7 @@ internal static void CreateRunAsAdministratorJumpList() thread.SetApartmentState(ApartmentState.STA); thread.Start(); } - catch (System.Threading.ThreadStartException) + catch (ThreadStartException) { // STA may not be supported on some platforms } @@ -117,7 +116,6 @@ private static void CreateElevatedEntry(string title) var CLSID_EnumerableObjectCollection = new Guid(@"2d3468c1-36a7-43b6-ac24-d3f02fd9607a"); const uint CLSCTX_INPROC_HANDLER = 2; const uint CLSCTX_INPROC = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER; - var ComSvrInterface_GUID = new Guid(@"555E2D2B-EE00-47AA-AB2B-39F953F6B339"); hResult = CoCreateInstance(ref CLSID_EnumerableObjectCollection, null, CLSCTX_INPROC, ref IID_IUnknown, out object instance); if (hResult < 0) { From 09509d2de31c928c674b71a4585078ef923899cb Mon Sep 17 00:00:00 2001 From: MartinGC94 <42123497+MartinGC94@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:22:11 +0100 Subject: [PATCH 0165/1168] Fix completion crash for the SCCM provider (#20815) --- .../CommandCompletion/CompletionCompleters.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index 357ce126ab5..1f5c68fa31a 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -4764,17 +4764,20 @@ private static List GetDefaultProviderResults( // Save relevant info and try again to get just the names. foreach (dynamic child in childItemOutput) { - childrenInfoTable.Add(GetChildNameFromPsObject(child, provider.ItemSeparator), child.PSIsContainer); + // TryAdd is used because some providers (like SCCM) may include duplicate PSPaths in a container. + _ = childrenInfoTable.TryAdd(GetChildNameFromPsObject(child, provider.ItemSeparator), child.PSIsContainer); } _ = context.Helper.CurrentPowerShell .AddCommandWithPreferenceSetting("Microsoft.PowerShell.Management\\Get-ChildItem") .AddParameter("LiteralPath", pathInfo.Path) - .AddParameter("Name"); + .AddParameter("Name") + .AddCommandWithPreferenceSetting("Microsoft.PowerShell.Utility\\Sort-Object") + .AddParameter("Unique"); childItemOutput = context.Helper.ExecuteCurrentPowerShell(out _); - foreach (var child in childItemOutput) + foreach (PSObject child in childItemOutput) { - var childName = (string)child.BaseObject; + string childName = (string)child.BaseObject; childNameList.Add(childName); } } @@ -4783,8 +4786,12 @@ private static List GetDefaultProviderResults( foreach (dynamic child in childItemOutput) { var childName = GetChildNameFromPsObject(child, provider.ItemSeparator); - childrenInfoTable.Add(childName, child.PSIsContainer); - childNameList.Add(childName); + + // TryAdd is used because some providers (like SCCM) may include duplicate PSPaths in a container. + if (childrenInfoTable.TryAdd(childName, child.PSIsContainer)) + { + childNameList.Add(childName); + } } } From 1d8b1650f4fa650b4396368d45360b33464b3256 Mon Sep 17 00:00:00 2001 From: Florian Heberl <49693964+floh96@users.noreply.github.com> Date: Mon, 11 Dec 2023 20:01:33 +0100 Subject: [PATCH 0166/1168] Make sure feedback link is clickable (#20878) --- .github/policies/IssueManagement.IssueFeedbackForm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/policies/IssueManagement.IssueFeedbackForm.yml b/.github/policies/IssueManagement.IssueFeedbackForm.yml index 9f1986d2e4a..f42be69ab1e 100644 --- a/.github/policies/IssueManagement.IssueFeedbackForm.yml +++ b/.github/policies/IssueManagement.IssueFeedbackForm.yml @@ -16,7 +16,7 @@ configuration: action: Closed then: - addReply: - reply: " 📣 Hey @${issueAuthor}, how did we do? We would love to hear your feedback with the link below! 🗣️ \n\n🔗 aka.ms/PSRepoFeedback " + reply: " 📣 Hey @${issueAuthor}, how did we do? We would love to hear your feedback with the link below! 🗣️ \n\n🔗 https://aka.ms/PSRepoFeedback " triggerOnOwnActions: true onFailure: onSuccess: From e4011d025ce10518bea24cfee7c4eddfe7d45d03 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:59:00 -0800 Subject: [PATCH 0167/1168] Bump xunit.runner.visualstudio from 2.5.4 to 2.5.5 (#20889) --- 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 97f82feca2b..886e7f8c5e0 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -25,7 +25,7 @@ - + From b77dd2407b114a0cbffba7546dafa4381ab6e1e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:59:23 -0800 Subject: [PATCH 0168/1168] Bump JsonSchema.Net from 5.4.0 to 5.4.2 (#20890) --- .../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 96b8c6d3018..f64610e1a58 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -35,7 +35,7 @@ - + From b4018d1b3580eb8d2235e4db9f0b85b45a4a6e48 Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Mon, 11 Dec 2023 13:19:23 -0800 Subject: [PATCH 0169/1168] Update to the latest NOTICES file (#20880) --- ThirdPartyNotices.txt | 58 ------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 41d8275fc5b..14aba61a13f 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -386,44 +386,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.Management.Infrastructure 2.0.0 - MIT - - -(c) Microsoft Corporation. - -MIT License - -Copyright (c) - -Permission is hereby 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: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -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 THE 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. - ---------------------------------------------------------- - ---------------------------------------------------------- - -Microsoft.Management.Infrastructure.Runtime.Unix 2.0.0 - MIT - - -(c) Microsoft Corporation. - -MIT License - -Copyright (c) - -Permission is hereby 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: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -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 THE 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. - ---------------------------------------------------------- - ---------------------------------------------------------- - Microsoft.PowerShell.MarkdownRender 7.2.1 - MIT @@ -444,26 +406,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.PowerShell.Native 7.3.2 - MIT - - -(c) Microsoft Corporation -Copyright (c) by P.J. Plauger - -MIT License - -Copyright (c) - -Permission is hereby 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: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -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 THE 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. - ---------------------------------------------------------- - ---------------------------------------------------------- - Microsoft.Security.Extensions 1.3.0 - MIT From 0adffa14707c51c85bd4fdf78627b748321127a4 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 11 Dec 2023 14:14:39 -0800 Subject: [PATCH 0170/1168] Bump `xUnit` to 2.6.3 and disable the `xUnit1031` warning (#20899) --- test/xUnit/AssemblyInfo.cs | 7 +++++++ test/xUnit/xUnit.tests.csproj | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 test/xUnit/AssemblyInfo.cs diff --git a/test/xUnit/AssemblyInfo.cs b/test/xUnit/AssemblyInfo.cs new file mode 100644 index 00000000000..7c4e92091db --- /dev/null +++ b/test/xUnit/AssemblyInfo.cs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +// Disable the warning 'xUnit1031': https://xunit.net/xunit.analyzers/rules/xUnit1031 +[assembly: SuppressMessage("xUnit", "xUnit1031", Justification = "Parallelization is disabled")] diff --git a/test/xUnit/xUnit.tests.csproj b/test/xUnit/xUnit.tests.csproj index 886e7f8c5e0..05797dd497f 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -23,7 +23,7 @@ - + From d47df6024e1fa4c47d6fde2ec6cbb5cb44689bff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 14:15:52 -0800 Subject: [PATCH 0171/1168] Bump Microsoft.NET.Test.Sdk from 17.7.2 to 17.8.0 (#20660) --- 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 05797dd497f..c8d2314d77a 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -27,7 +27,7 @@ - + From ecbe1b9dcb69305dc7d188c860d182871895fda8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 15:59:20 -0800 Subject: [PATCH 0172/1168] Bump Microsoft.ApplicationInsights from 2.21.0 to 2.22.0 (#20888) --- .../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 e1fbfce6894..5fcc51c6269 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -32,7 +32,7 @@ - + From 7d62cf54ac6339c211dadba2e7d8e8da7b0d10e3 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 13 Dec 2023 11:46:21 -0800 Subject: [PATCH 0173/1168] Fix 4 issues for the WDAC logging feature (#20913) --- .../engine/LanguagePrimitives.cs | 56 ++++++++++--------- .../engine/remoting/client/RunspaceRef.cs | 20 ++++++- .../remoting/commands/PSRemotingCmdlet.cs | 4 +- .../engine/runtime/Binding/Binders.cs | 2 +- .../engine/runtime/Operations/MiscOps.cs | 18 +++++- .../resources/ParserStrings.resx | 6 ++ .../resources/RemotingErrorIdStrings.resx | 6 ++ 7 files changed, 77 insertions(+), 35 deletions(-) diff --git a/src/System.Management.Automation/engine/LanguagePrimitives.cs b/src/System.Management.Automation/engine/LanguagePrimitives.cs index ac78e5e80d5..87a6dcb7804 100644 --- a/src/System.Management.Automation/engine/LanguagePrimitives.cs +++ b/src/System.Management.Automation/engine/LanguagePrimitives.cs @@ -3986,44 +3986,46 @@ internal object Convert(object valueToConvert, // - It's in FullLanguage but not because it's part of a parameter binding that is transitioning from ConstrainedLanguage to FullLanguage // When this is invoked from a parameter binding in transition from ConstrainedLanguage environment to FullLanguage command, we disallow // the property conversion because it's dangerous. - if (ecFromTLS == null || (ecFromTLS.LanguageMode == PSLanguageMode.FullLanguage && !ecFromTLS.LanguageModeTransitionInParameterBinding)) + bool canProceedWithConversion = ecFromTLS == null || (ecFromTLS.LanguageMode == PSLanguageMode.FullLanguage && !ecFromTLS.LanguageModeTransitionInParameterBinding); + if (!canProceedWithConversion) { - result = _constructor(); - var psobject = valueToConvert as PSObject; - if (psobject != null) - { - // Use PSObject properties to perform conversion. - SetObjectProperties(result, psobject, resultType, CreateMemberNotFoundError, CreateMemberSetValueError, formatProvider, recursion, ignoreUnknownMembers); - } - else + if (SystemPolicy.GetSystemLockdownPolicy() != SystemEnforcementMode.Audit) { - // Use provided property dictionary to perform conversion. - // The method invocation is disabled for "Hashtable to Object conversion" (Win8:649519), but we need to keep it enabled for New-Object for compatibility to PSv2 - IDictionary properties = valueToConvert as IDictionary; - SetObjectProperties(result, properties, resultType, CreateMemberNotFoundError, CreateMemberSetValueError, enableMethodCall: false); + throw InterpreterError.NewInterpreterException( + valueToConvert, + typeof(RuntimeException), + errorPosition: null, + "HashtableToObjectConversionNotSupportedInDataSection", + ParserStrings.HashtableToObjectConversionNotSupportedInDataSection, + resultType.ToString()); } - typeConversion.WriteLine("Constructor result: \"{0}\".", result); - } - else - { - if (SystemPolicy.GetSystemLockdownPolicy() == SystemEnforcementMode.Audit) - { - SystemPolicy.LogWDACAuditMessage( + // When in audit mode, we report but don't enforce, so we will proceed with the conversion. + SystemPolicy.LogWDACAuditMessage( context: ecFromTLS, title: ExtendedTypeSystem.WDACHashTypeLogTitle, message: StringUtil.Format(ExtendedTypeSystem.WDACHashTypeLogMessage, resultType.FullName), fqid: "LanguageHashtableConversionNotAllowed", dropIntoDebugger: true); - } - else - { - RuntimeException rte = InterpreterError.NewInterpreterException(valueToConvert, typeof(RuntimeException), null, - "HashtableToObjectConversionNotSupportedInDataSection", ParserStrings.HashtableToObjectConversionNotSupportedInDataSection, resultType.ToString()); - throw rte; - } } + result = _constructor(); + var psobject = valueToConvert as PSObject; + if (psobject != null) + { + // Use PSObject properties to perform conversion. + SetObjectProperties(result, psobject, resultType, CreateMemberNotFoundError, CreateMemberSetValueError, formatProvider, recursion, ignoreUnknownMembers); + } + else + { + // Use provided property dictionary to perform conversion. + // The method invocation is disabled for "Hashtable to Object conversion" (Win8:649519), but we need to keep it enabled for New-Object for compatibility to PSv2 + IDictionary properties = valueToConvert as IDictionary; + SetObjectProperties(result, properties, resultType, CreateMemberNotFoundError, CreateMemberSetValueError, enableMethodCall: false); + } + + typeConversion.WriteLine("Constructor result: \"{0}\".", result); + return result; } catch (TargetInvocationException ex) diff --git a/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs b/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs index b3bfbe9a0d9..f76b836885a 100644 --- a/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs +++ b/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs @@ -5,6 +5,7 @@ using System.Management.Automation.Internal; using System.Management.Automation.Runspaces; using System.Management.Automation.Runspaces.Internal; +using System.Management.Automation.Security; using Dbg = System.Management.Automation.Diagnostics; @@ -94,7 +95,22 @@ private PSCommand ParsePsCommandUsingScriptBlock(string line, bool? useLocalScop // to be parsed and evaluated on the remote session (not in the current local session). RemoteRunspace remoteRunspace = _runspaceRef.Value as RemoteRunspace; bool isConfiguredLoopback = remoteRunspace != null && remoteRunspace.IsConfiguredLoopBack; - bool isTrustedInput = !isConfiguredLoopback && (localRunspace.ExecutionContext.LanguageMode == PSLanguageMode.FullLanguage); + + bool inFullLanguage = context.LanguageMode == PSLanguageMode.FullLanguage; + if (context.LanguageMode == PSLanguageMode.ConstrainedLanguage + && SystemPolicy.GetSystemLockdownPolicy() == SystemEnforcementMode.Audit) + { + // In audit mode, report but don't enforce. + inFullLanguage = true; + SystemPolicy.LogWDACAuditMessage( + context: context, + title: RemotingErrorIdStrings.WDACGetPowerShellLogTitle, + message: RemotingErrorIdStrings.WDACGetPowerShellLogMessage, + fqid: "GetPowerShellMayFail", + dropIntoDebugger: true); + } + + bool isTrustedInput = !isConfiguredLoopback && inFullLanguage; // Create PowerShell from ScriptBlock. ScriptBlock scriptBlock = ScriptBlock.Create(context, line); @@ -350,7 +366,7 @@ internal void Override(RemoteRunspace remoteRunspace, object syncObject, out boo /// private void HandleHostCall(object sender, RemoteDataEventArgs eventArgs) { - System.Management.Automation.Runspaces.Internal.ClientRemotePowerShell.ExitHandler(sender, eventArgs); + ClientRemotePowerShell.ExitHandler(sender, eventArgs); } #region Robust Connection Support diff --git a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs index c633fd9fe5c..3c38a3b5bdc 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs @@ -2278,7 +2278,7 @@ private System.Management.Automation.PowerShell GetPowerShellForPSv3OrLater(stri // Semantic checks on the using statement have already validated that there are no arbitrary expressions, // so we'll allow these expressions in everything but NoLanguage mode. - bool allowUsingExpressions = (Context.SessionState.LanguageMode != PSLanguageMode.NoLanguage); + bool allowUsingExpressions = Context.SessionState.LanguageMode != PSLanguageMode.NoLanguage; object[] usingValuesInArray = null; IDictionary usingValuesInDict = null; @@ -2428,7 +2428,7 @@ private List GetUsingVariableValues(List paramUsi // GetExpressionValue ensures that it only does variable access when supplied a VariableExpressionAst. // So, this is still safe to use in ConstrainedLanguage and will not result in arbitrary code // execution. - bool allowVariableAccess = (Context.SessionState.LanguageMode != PSLanguageMode.NoLanguage); + bool allowVariableAccess = Context.SessionState.LanguageMode != PSLanguageMode.NoLanguage; foreach (var varAst in paramUsingVars) { diff --git a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs index c93041a7b68..3e3ec3fbca5 100644 --- a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs +++ b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs @@ -5524,7 +5524,7 @@ internal static DynamicMetaObject EnsureAllowedInLanguageMode(DynamicMetaObject return target.ThrowRuntimeError(args, moreTests, errorID, resourceString); } - string targetName = (targetValue as Type)?.FullName; + string targetName = (targetValue as Type)?.FullName ?? targetValue?.GetType().FullName; SystemPolicy.LogWDACAuditMessage( context: context, title: ParameterBinderStrings.WDACBinderInvocationLogTitle, diff --git a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs index eb3100ea512..8452c27b989 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs @@ -714,6 +714,18 @@ internal static SteppablePipeline GetSteppablePipeline(PipelineAst pipelineAst, // of invoking it. So the trustworthiness is defined by the trustworthiness of the // script block's language mode. bool isTrusted = scriptBlock.LanguageMode == PSLanguageMode.FullLanguage; + if (scriptBlock.LanguageMode == PSLanguageMode.ConstrainedLanguage + && SystemPolicy.GetSystemLockdownPolicy() == SystemEnforcementMode.Audit) + { + // In audit mode, report but don't enforce. + isTrusted = true; + SystemPolicy.LogWDACAuditMessage( + context: context, + title: ParserStrings.WDACGetSteppablePipelineLogTitle, + message: ParserStrings.WDACGetSteppablePipelineLogMessage, + fqid: "GetSteppablePipelineMayFail", + dropIntoDebugger: true); + } foreach (var commandAst in pipelineAst.PipelineElements.Cast()) { @@ -729,7 +741,7 @@ internal static SteppablePipeline GetSteppablePipeline(PipelineAst pipelineAst, var exprAst = (ExpressionAst)commandElement; var argument = Compiler.GetExpressionValue(exprAst, isTrusted, context); - var splatting = (exprAst is VariableExpressionAst && ((VariableExpressionAst)exprAst).Splatted); + var splatting = exprAst is VariableExpressionAst && ((VariableExpressionAst)exprAst).Splatted; commandParameters.Add(CommandParameterInternal.CreateArgument(argument, exprAst, splatting)); } @@ -797,8 +809,8 @@ private static CommandParameterInternal GetCommandParameter(CommandParameterAst } object argumentValue = Compiler.GetExpressionValue(argumentAst, isTrusted, context); - bool spaceAfterParameter = (errorPos.EndLineNumber != argumentAst.Extent.StartLineNumber || - errorPos.EndColumnNumber != argumentAst.Extent.StartColumnNumber); + bool spaceAfterParameter = errorPos.EndLineNumber != argumentAst.Extent.StartLineNumber || + errorPos.EndColumnNumber != argumentAst.Extent.StartColumnNumber; return CommandParameterInternal.CreateParameterWithArgument(commandParameterAst, commandParameterAst.ParameterName, errorPos.Text, argumentAst, argumentValue, spaceAfterParameter); diff --git a/src/System.Management.Automation/resources/ParserStrings.resx b/src/System.Management.Automation/resources/ParserStrings.resx index 5631525cacc..a45a5165b03 100644 --- a/src/System.Management.Automation/resources/ParserStrings.resx +++ b/src/System.Management.Automation/resources/ParserStrings.resx @@ -1361,4 +1361,10 @@ ModuleVersion : Version of module to import. If used, ModuleName must represent The ForEach keyword will fail '{0}' iteration item method invocation when run in Constrained Language mode. + + Expression Evaluation May Fail + + + Creating a steppable pipeline from a script block may require evaluating some expressions within the script block. The expression evaluation will silently fail and return 'null' in Constrained Language mode, unless the expression represents a constant value. + diff --git a/src/System.Management.Automation/resources/RemotingErrorIdStrings.resx b/src/System.Management.Automation/resources/RemotingErrorIdStrings.resx index f65d536f639..c45416edb4b 100644 --- a/src/System.Management.Automation/resources/RemotingErrorIdStrings.resx +++ b/src/System.Management.Automation/resources/RemotingErrorIdStrings.resx @@ -1714,4 +1714,10 @@ SSH client process terminated before connection could be established. The session configuration file contains an unknown configuration option: {0}. + + Expression Evaluation May Fail + + + Creating a PowerShell object from a script block may require evaluating some expressions within the script block. The expression evaluation will silently fail and return 'null' in Constrained Language mode, unless the expression represents a constant value. + From 64de048b4a03dcdd2db92db09caaf1e400c499c7 Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Wed, 13 Dec 2023 11:56:39 -0800 Subject: [PATCH 0174/1168] Update the cgmanifest (#20906) --- tools/cgmanifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index ff5ad871cf4..1f3097f9f9e 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -56,7 +56,7 @@ "Type": "nuget", "Nuget": { "Name": "JsonSchema.Net", - "Version": "5.4.0" + "Version": "5.4.2" } }, "DevelopmentDependency": false @@ -76,7 +76,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.ApplicationInsights", - "Version": "2.21.0" + "Version": "2.22.0" } }, "DevelopmentDependency": false From 43333bc80e0b834a664556289e54eb1c9c07e657 Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Wed, 13 Dec 2023 20:17:04 +0000 Subject: [PATCH 0175/1168] Ensure filename is not null when loggin WDAC ETW events (#20910) --- src/System.Management.Automation/utils/tracing/PSEtwLog.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/utils/tracing/PSEtwLog.cs b/src/System.Management.Automation/utils/tracing/PSEtwLog.cs index 6ec720566d5..45f8f39eea9 100644 --- a/src/System.Management.Automation/utils/tracing/PSEtwLog.cs +++ b/src/System.Management.Automation/utils/tracing/PSEtwLog.cs @@ -141,7 +141,7 @@ internal static void LogWDACQueryEvent( int querySuccess, int queryResult) { - provider.LogWDACQueryEvent(queryName, fileName, querySuccess, queryResult); + provider.LogWDACQueryEvent(queryName, fileName ?? string.Empty, querySuccess, queryResult); } /// From 649e809d57efa53f4242c536ab62cea0768dd383 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 13 Dec 2023 16:53:52 -0800 Subject: [PATCH 0176/1168] Revert "Fix completion crash for the SCCM provider (#20815)" (#20919) --- .../CommandCompletion/CompletionCompleters.cs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index 1f5c68fa31a..357ce126ab5 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -4764,20 +4764,17 @@ private static List GetDefaultProviderResults( // Save relevant info and try again to get just the names. foreach (dynamic child in childItemOutput) { - // TryAdd is used because some providers (like SCCM) may include duplicate PSPaths in a container. - _ = childrenInfoTable.TryAdd(GetChildNameFromPsObject(child, provider.ItemSeparator), child.PSIsContainer); + childrenInfoTable.Add(GetChildNameFromPsObject(child, provider.ItemSeparator), child.PSIsContainer); } _ = context.Helper.CurrentPowerShell .AddCommandWithPreferenceSetting("Microsoft.PowerShell.Management\\Get-ChildItem") .AddParameter("LiteralPath", pathInfo.Path) - .AddParameter("Name") - .AddCommandWithPreferenceSetting("Microsoft.PowerShell.Utility\\Sort-Object") - .AddParameter("Unique"); + .AddParameter("Name"); childItemOutput = context.Helper.ExecuteCurrentPowerShell(out _); - foreach (PSObject child in childItemOutput) + foreach (var child in childItemOutput) { - string childName = (string)child.BaseObject; + var childName = (string)child.BaseObject; childNameList.Add(childName); } } @@ -4786,12 +4783,8 @@ private static List GetDefaultProviderResults( foreach (dynamic child in childItemOutput) { var childName = GetChildNameFromPsObject(child, provider.ItemSeparator); - - // TryAdd is used because some providers (like SCCM) may include duplicate PSPaths in a container. - if (childrenInfoTable.TryAdd(childName, child.PSIsContainer)) - { - childNameList.Add(childName); - } + childrenInfoTable.Add(childName, child.PSIsContainer); + childNameList.Add(childName); } } From 455865cf758960eeffbe7e455cf2ee7beb16f27e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 10:09:31 -0800 Subject: [PATCH 0177/1168] Bump Markdig.Signed from 0.33.0 to 0.34.0 (#20926) --- .../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 f64610e1a58..c2c4b46ff92 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -8,7 +8,7 @@ - + From 350d88a7098b2026d8af4e3ddda4918fb2bdeccf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 10:10:01 -0800 Subject: [PATCH 0178/1168] Bump github/codeql-action from 2 to 3 (#20927) --- .github/workflows/codeql-analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a18163af84d..c53356c795f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -43,7 +43,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -66,4 +66,4 @@ jobs: name: Build - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 From 72a3caa8411ddd464cf78ba6e78c3c4d3cd79f3e Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Fri, 15 Dec 2023 10:52:14 +0100 Subject: [PATCH 0179/1168] Fixing incorrect formatting string in CommandSearcher trace logging. (#20928) --- .../engine/CommandSearcher.cs | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/System.Management.Automation/engine/CommandSearcher.cs b/src/System.Management.Automation/engine/CommandSearcher.cs index 9acbae68ad0..4bf39d2c1fd 100644 --- a/src/System.Management.Automation/engine/CommandSearcher.cs +++ b/src/System.Management.Automation/engine/CommandSearcher.cs @@ -951,24 +951,13 @@ private static bool ShouldSkipCommandResolutionForConstrainedLanguage(CommandInf if (result != null) { - if (result is FilterInfo) + var formatString = result switch { - CommandDiscovery.discoveryTracer.WriteLine( - "Filter found: {0}", - function); - } - else if (result is ConfigurationInfo) - { - CommandDiscovery.discoveryTracer.WriteLine( - "Configuration found: {0}", - function); - } - else - { - CommandDiscovery.discoveryTracer.WriteLine( - "Function found: {0} {1}", - function); - } + FilterInfo => "Filter found: {0}", + ConfigurationInfo => "Configuration found: {0}", + _ => "Function found: {0}", + }; + CommandDiscovery.discoveryTracer.WriteLine(formatString, function); } else { From 0e18be6659aad4171736faf7f6b94a835cf6f12e Mon Sep 17 00:00:00 2001 From: Armaan Mcleod Date: Sun, 17 Dec 2023 03:34:51 +1100 Subject: [PATCH 0180/1168] Add `-Verb` argument completer for `Get-Verb`/ `Get-Command` and refactor `Get-Verb` (#20286) --- .../commands/utility/GetVerbCommand.cs | 45 +--- .../engine/GetCommandCommand.cs | 2 + .../utils/Verbs.cs | 238 +++++++++++++++++- .../TabCompletion/TabCompletion.Tests.ps1 | 51 ++++ 4 files changed, 290 insertions(+), 46 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetVerbCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetVerbCommand.cs index 1ec93b0f1d7..61a0fe1a390 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetVerbCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetVerbCommand.cs @@ -1,10 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.Collections.ObjectModel; using System.Management.Automation; -using System.Reflection; +using static System.Management.Automation.Verbs; namespace Microsoft.PowerShell.Commands { @@ -19,6 +17,7 @@ public class GetVerbCommand : Cmdlet /// Optional Verb filter. /// [Parameter(ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, Position = 0)] + [ArgumentCompleter(typeof(VerbArgumentCompleter))] public string[] Verb { get; set; @@ -39,45 +38,9 @@ public string[] Group /// protected override void ProcessRecord() { - Type[] verbTypes = new Type[] { typeof(VerbsCommon), typeof(VerbsCommunications), typeof(VerbsData), - typeof(VerbsDiagnostic), typeof(VerbsLifecycle), typeof(VerbsOther), typeof(VerbsSecurity) }; - - Collection matchingVerbs = SessionStateUtilities.CreateWildcardsFromStrings( - this.Verb, - WildcardOptions.IgnoreCase - ); - - foreach (Type type in verbTypes) + foreach (VerbInfo verb in FilterByVerbsAndGroups(Verb, Group)) { - string groupName = type.Name.Substring(5); - if (this.Group != null) - { - if (!SessionStateUtilities.CollectionContainsValue(this.Group, groupName, StringComparer.OrdinalIgnoreCase)) - { - continue; - } - } - - foreach (FieldInfo field in type.GetFields()) - { - if (field.IsLiteral) - { - if (this.Verb != null) - { - if (!SessionStateUtilities.MatchesAnyWildcardPattern(field.Name, matchingVerbs, false)) - { - continue; - } - } - - VerbInfo verb = new(); - verb.Verb = field.Name; - verb.AliasPrefix = VerbAliasPrefixes.GetVerbAliasPrefix(field.Name); - verb.Group = groupName; - verb.Description = VerbDescriptions.GetVerbDescription(field.Name); - WriteObject(verb); - } - } + WriteObject(verb); } } } diff --git a/src/System.Management.Automation/engine/GetCommandCommand.cs b/src/System.Management.Automation/engine/GetCommandCommand.cs index 9784cdc9ea8..db6ce736bba 100644 --- a/src/System.Management.Automation/engine/GetCommandCommand.cs +++ b/src/System.Management.Automation/engine/GetCommandCommand.cs @@ -12,6 +12,7 @@ using System.Management.Automation; using System.Management.Automation.Internal; using System.Management.Automation.Language; +using static System.Management.Automation.Verbs; using Dbg = System.Management.Automation.Diagnostics; namespace Microsoft.PowerShell.Commands @@ -71,6 +72,7 @@ public string[] Name /// Gets or sets the verb parameter to the cmdlet. /// [Parameter(ValueFromPipelineByPropertyName = true, ParameterSetName = "CmdletSet")] + [ArgumentCompleter(typeof(VerbArgumentCompleter))] public string[] Verb { get diff --git a/src/System.Management.Automation/utils/Verbs.cs b/src/System.Management.Automation/utils/Verbs.cs index e234609359a..f06dd2d19e0 100644 --- a/src/System.Management.Automation/utils/Verbs.cs +++ b/src/System.Management.Automation/utils/Verbs.cs @@ -1,10 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +using System.Collections; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; +using System.Management.Automation.Language; using System.Reflection; - +using Microsoft.PowerShell.Commands; using Dbg = System.Management.Automation.Diagnostics; namespace System.Management.Automation @@ -1157,10 +1160,7 @@ internal static class Verbs { static Verbs() { - Type[] verbTypes = new Type[] { typeof(VerbsCommon), typeof(VerbsCommunications), typeof(VerbsData), - typeof(VerbsDiagnostic), typeof(VerbsLifecycle), typeof(VerbsOther), typeof(VerbsSecurity) }; - - foreach (Type type in verbTypes) + foreach (Type type in VerbTypes) { foreach (FieldInfo field in type.GetFields()) { @@ -1311,6 +1311,234 @@ static Verbs() #endif } + /// + /// Gets all verb types. + /// + /// List of all verb types. + private static Type[] VerbTypes => new Type[] { + typeof(VerbsCommon), + typeof(VerbsCommunications), + typeof(VerbsData), + typeof(VerbsDiagnostic), + typeof(VerbsLifecycle), + typeof(VerbsOther), + typeof(VerbsSecurity) + }; + + /// + /// Gets verb group display name from type. + /// + /// The verb type. + /// Verb group display name. + private static string GetVerbGroupDisplayName(Type verbType) => verbType.Name.Substring(5); + + /// + /// Filters by verbs and commands. + /// + /// The array of verbs. + /// The collection of commands. + /// List of Verbs. + private static IEnumerable FilterByVerbsAndCommands(string[] verbs, Collection commands) + { + if (commands is null || commands.Count == 0) + { + yield break; + } + + Collection verbPatterns = SessionStateUtilities.CreateWildcardsFromStrings( + verbs, + WildcardOptions.IgnoreCase); + + foreach (CmdletInfo command in commands) + { + if (SessionStateUtilities.MatchesAnyWildcardPattern( + command.Verb, + verbPatterns, + defaultValue: false)) + { + yield return command.Verb; + } + } + } + + /// + /// Filters by verbs and groups. + /// + /// The array of verbs. + /// The array of groups. + /// List of Verbs. + internal static IEnumerable FilterByVerbsAndGroups(string[] verbs, string[] groups) + { + if (groups is null || groups.Length == 0) + { + foreach (Type verbType in VerbTypes) + { + foreach (VerbInfo verb in FilterVerbsByType(verbs, verbType)) + { + yield return verb; + } + } + + yield break; + } + + foreach (Type verbType in VerbTypes) + { + if (SessionStateUtilities.CollectionContainsValue( + groups, + GetVerbGroupDisplayName(verbType), + StringComparer.OrdinalIgnoreCase)) + { + foreach (VerbInfo verb in FilterVerbsByType(verbs, verbType)) + { + yield return verb; + } + } + } + } + + /// + /// Filters verbs by type. + /// + /// The array of verbs. + /// The verb type. + /// List of Verbs. + private static IEnumerable FilterVerbsByType(string[] verbs, Type verbType) + { + if (verbs is null || verbs.Length == 0) + { + foreach (FieldInfo field in verbType.GetFields()) + { + if (field.IsLiteral) + { + yield return CreateVerbFromField(field, verbType); + } + } + + yield break; + } + + Collection verbPatterns = SessionStateUtilities.CreateWildcardsFromStrings( + verbs, + WildcardOptions.IgnoreCase); + + foreach (FieldInfo field in verbType.GetFields()) + { + if (field.IsLiteral) + { + if (SessionStateUtilities.MatchesAnyWildcardPattern( + field.Name, + verbPatterns, + defaultValue: false)) + { + yield return CreateVerbFromField(field, verbType); + } + } + } + } + + /// + /// Creates Verb info object from field info. + /// + /// The field. + /// The verb type. + /// VerbInfo object. + private static VerbInfo CreateVerbFromField(FieldInfo field, Type verbType) => new() + { + Verb = field.Name, + AliasPrefix = VerbAliasPrefixes.GetVerbAliasPrefix(field.Name), + Group = GetVerbGroupDisplayName(verbType), + Description = VerbDescriptions.GetVerbDescription(field.Name) + }; + + /// + /// Provides argument completion for Verb parameter. + /// + public class VerbArgumentCompleter : IArgumentCompleter + { + /// + /// Returns completion results for verb parameter. + /// + /// The command name. + /// The parameter name. + /// The word to complete. + /// The command AST. + /// The fake bound parameters. + /// List of Completion Results. + public IEnumerable CompleteArgument( + string commandName, + string parameterName, + string wordToComplete, + CommandAst commandAst, + IDictionary fakeBoundParameters) + { + var verbs = new string[] { wordToComplete + "*" }; + + // Completion: Get-Verb -Group -Verb + if (commandName.Equals("Get-Verb", StringComparison.OrdinalIgnoreCase) + && fakeBoundParameters.Contains("Group")) + { + string[] groups = null; + + object groupParameterValue = fakeBoundParameters["Group"]; + Type groupParameterValueType = groupParameterValue.GetType(); + + if (groupParameterValueType == typeof(string)) + { + groups = new string[] { groupParameterValue.ToString() }; + } + + else if (groupParameterValueType.IsArray + && groupParameterValueType.GetElementType() == typeof(object)) + { + groups = Array.ConvertAll((object[])groupParameterValue, group => group.ToString()); + } + + foreach (VerbInfo verb in FilterByVerbsAndGroups(verbs, groups)) + { + yield return new CompletionResult(verb.Verb); + } + + yield break; + } + + // Completion: Get-Command -Noun -Verb + else if (commandName.Equals("Get-Command", StringComparison.OrdinalIgnoreCase) + && fakeBoundParameters.Contains("Noun")) + { + using var ps = PowerShell.Create(RunspaceMode.CurrentRunspace); + + var commandInfo = new CmdletInfo("Get-Command", typeof(GetCommandCommand)); + + ps.AddCommand(commandInfo); + ps.AddParameter("Noun", fakeBoundParameters["Noun"]); + + if (fakeBoundParameters.Contains("Module")) + { + ps.AddParameter("Module", fakeBoundParameters["Module"]); + } + + Collection commands = ps.Invoke(); + + foreach (string verb in FilterByVerbsAndCommands(verbs, commands)) + { + yield return new CompletionResult(verb); + } + + yield break; + } + + // Complete all verbs by default if above cases not completed + foreach (Type verbType in VerbTypes) + { + foreach (VerbInfo verb in FilterVerbsByType(verbs, verbType)) + { + yield return new CompletionResult(verb.Verb); + } + } + } + } + private static readonly Dictionary s_validVerbs = new Dictionary(StringComparer.OrdinalIgnoreCase); private static readonly Dictionary s_recommendedAlternateVerbs = new Dictionary(StringComparer.OrdinalIgnoreCase); diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index 14b4b3adf3a..0b03155be3a 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -744,6 +744,57 @@ ConstructorTestClass(int i, bool b) $res.CompletionMatches[0].CompletionText | Should -BeExactly '$TestVar1' } + Context 'Get-Verb & Get-Command -Verb parameter completion' { + BeforeAll { + $allVerbs = 'Add Approve Assert Backup Block Build Checkpoint Clear Close Compare Complete Compress Confirm Connect Convert ConvertFrom ConvertTo Copy Debug Deny Deploy Disable Disconnect Dismount Edit Enable Enter Exit Expand Export Find Format Get Grant Group Hide Import Initialize Install Invoke Join Limit Lock Measure Merge Mount Move New Open Optimize Out Ping Pop Protect Publish Push Read Receive Redo Register Remove Rename Repair Request Reset Resize Resolve Restart Restore Resume Revoke Save Search Select Send Set Show Skip Split Start Step Stop Submit Suspend Switch Sync Test Trace Unblock Undo Uninstall Unlock Unprotect Unpublish Unregister Update Use Wait Watch Write' + $verbsStartingWithRe = 'Read Receive Redo Register Remove Rename Repair Request Reset Resize Resolve Restart Restore Resume Revoke' + $verbsStartingWithEx = 'Exit Expand Export' + $verbsStartingWithConv = 'Convert ConvertFrom ConvertTo' + $lifeCycleVerbsStartingWithRe = 'Register Request Restart Resume' + $dataVerbsStartingwithEx = 'Expand Export' + $lifeCycleAndCommmonVerbsStartingWithRe = 'Redo Register Remove Rename Request Reset Resize Restart Resume' + $allLifeCycleAndCommonVerbs = 'Add Approve Assert Build Clear Close Complete Confirm Copy Deny Deploy Disable Enable Enter Exit Find Format Get Hide Install Invoke Join Lock Move New Open Optimize Pop Push Redo Register Remove Rename Request Reset Resize Restart Resume Search Select Set Show Skip Split Start Step Stop Submit Suspend Switch Undo Uninstall Unlock Unregister Wait Watch' + $allJsonVerbs = 'ConvertFrom ConvertTo Test' + $jsonVerbsStartingWithConv = 'ConvertFrom ConvertTo' + $allJsonAndJobVerbs = 'ConvertFrom ConvertTo Debug Get Receive Remove Start Stop Test Wait' + $jsonAndJobVerbsStartingWithSt = 'Start Stop' + $allObjectVerbs = 'Compare ForEach Group Measure New Select Sort Tee Where' + $utilityModuleObjectVerbs = 'Compare Group Measure New Select Sort Tee' + $utilityModuleObjectVerbsStartingWithS = 'Select Sort' + $coreModuleObjectVerbs = 'ForEach Where' + } + + It "Should complete Verb parameter for ''" -TestCases @( + @{ TextInput = 'Get-Verb -Verb '; ExpectedVerbs = $allVerbs } + @{ TextInput = 'Get-Verb -Group Lifecycle, Common -Verb '; ExpectedVerbs = $allLifeCycleAndCommonVerbs } + @{ TextInput = 'Get-Verb -Verb Re'; ExpectedVerbs = $verbsStartingWithRe } + @{ TextInput = 'Get-Verb -Group Lifecycle -Verb Re'; ExpectedVerbs = $lifeCycleVerbsStartingWithRe } + @{ TextInput = 'Get-Verb -Group Lifecycle, Common -Verb Re'; ExpectedVerbs = $lifeCycleAndCommmonVerbsStartingWithRe } + @{ TextInput = 'Get-Verb -Verb Ex'; ExpectedVerbs = $verbsStartingWithEx } + @{ TextInput = 'Get-Verb -Group Data -Verb Ex'; ExpectedVerbs = $dataVerbsStartingwithEx } + @{ TextInput = 'Get-Verb -Group NonExistentGroup -Verb '; ExpectedVerbs = '' } + @{ TextInput = 'Get-Verb -Verb Conv'; ExpectedVerbs = $verbsStartingWithConv } + @{ TextInput = 'Get-Command -Verb '; ExpectedVerbs = $allVerbs } + @{ TextInput = 'Get-Command -Verb Re'; ExpectedVerbs = $verbsStartingWithRe } + @{ TextInput = 'Get-Command -Verb Ex'; ExpectedVerbs = $verbsStartingWithEx } + @{ TextInput = 'Get-Command -Verb Conv'; ExpectedVerbs = $verbsStartingWithConv } + @{ TextInput = 'Get-Command -Noun Json -Verb '; ExpectedVerbs = $allJsonVerbs } + @{ TextInput = 'Get-Command -Noun Json -Verb Conv'; ExpectedVerbs = $jsonVerbsStartingWithConv } + @{ TextInput = 'Get-Command -Noun Json, Job -Verb '; ExpectedVerbs = $allJsonAndJobVerbs } + @{ TextInput = 'Get-Command -Noun Json, Job -Verb St'; ExpectedVerbs = $jsonAndJobVerbsStartingWithSt } + @{ TextInput = 'Get-Command -Noun NonExistentNoun -Verb '; ExpectedVerbs = '' } + @{ TextInput = 'Get-Command -Noun Object -Module Microsoft.PowerShell.Utility,Microsoft.PowerShell.Core -Verb '; ExpectedVerbs = $allObjectVerbs } + @{ TextInput = 'Get-Command -Noun Object -Module Microsoft.PowerShell.Utility -Verb '; ExpectedVerbs = $utilityModuleObjectVerbs } + @{ TextInput = 'Get-Command -Noun Object -Module Microsoft.PowerShell.Utility -Verb S'; ExpectedVerbs = $utilityModuleObjectVerbsStartingWithS } + @{ TextInput = 'Get-Command -Noun Object -Module Microsoft.PowerShell.Core -Verb '; ExpectedVerbs = $coreModuleObjectVerbs } + ) { + param($TextInput, $ExpectedVerbs) + $res = TabExpansion2 -inputScript $TextInput -cursorColumn $TextInput.Length + $completionText = $res.CompletionMatches.CompletionText | Sort-Object + $completionText -join ' ' | Should -BeExactly $ExpectedVerbs + } + } + Context 'StrictMode Version parameter completion' { BeforeAll { $allStrictModeVersions = '1.0 2.0 3.0 Latest' From 37547567b8068a44d34f9970dd8f92d27e9b87aa Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:22:57 -0800 Subject: [PATCH 0181/1168] Update the cgmanifest (#20933) --- tools/cgmanifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index 1f3097f9f9e..25a318c7580 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -66,7 +66,7 @@ "Type": "nuget", "Nuget": { "Name": "Markdig.Signed", - "Version": "0.33.0" + "Version": "0.34.0" } }, "DevelopmentDependency": false From 9383f554a2c719af88010a66e2a283fa93c07db9 Mon Sep 17 00:00:00 2001 From: Armaan Mcleod Date: Tue, 19 Dec 2023 20:12:33 +1100 Subject: [PATCH 0182/1168] Add `-Scope` argument completer for `*-Variable`, `*-Alias` & `*-PSDrive` commands (#20451) --- .../commands/management/Navigation.cs | 3 ++ .../commands/utility/ExportAliasCommand.cs | 1 + .../commands/utility/GetAliasCommand.cs | 1 + .../commands/utility/ImportAliasCommand.cs | 1 + .../commands/utility/RemoveAliasCommand.cs | 1 + .../commands/utility/Var.cs | 1 + .../commands/utility/WriteAliasCommandBase.cs | 1 + .../ScopeArgumentCompleter.cs | 44 +++++++++++++++++++ .../TabCompletion/TabCompletion.Tests.ps1 | 26 +++++++++++ 9 files changed, 79 insertions(+) create mode 100644 src/System.Management.Automation/engine/CommandCompletion/ScopeArgumentCompleter.cs diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs index 8bc149c2cf1..17e88a0e116 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs @@ -1129,6 +1129,7 @@ public string Description /// Gets or sets the scope identifier for the drive being created. /// [Parameter(ValueFromPipelineByPropertyName = true)] + [ArgumentCompleter(typeof(ScopeArgumentCompleter))] public string Scope { get; set; } #if !UNIX @@ -1533,6 +1534,7 @@ public string[] PSProvider /// global scope until a drive of the given name is found to remove. /// [Parameter(ValueFromPipelineByPropertyName = true)] + [ArgumentCompleter(typeof(ScopeArgumentCompleter))] public string Scope { get; set; } /// @@ -1701,6 +1703,7 @@ public string[] LiteralName /// Gets or sets the scope parameter to the command. /// [Parameter(ValueFromPipelineByPropertyName = true)] + [ArgumentCompleter(typeof(ScopeArgumentCompleter))] public string Scope { get; set; } /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs index 33deb01eb2c..d6f2c661ad0 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs @@ -184,6 +184,7 @@ public SwitchParameter NoClobber /// which scope the aliases are retrieved from. /// [Parameter] + [ArgumentCompleter(typeof(ScopeArgumentCompleter))] public string Scope { get; set; } #endregion Parameters diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetAliasCommand.cs index bf4c8a39db4..7b93b555c5c 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetAliasCommand.cs @@ -51,6 +51,7 @@ public string[] Exclude /// which scope the aliases are retrieved from. /// [Parameter] + [ArgumentCompleter(typeof(ScopeArgumentCompleter))] public string Scope { get; set; } /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs index 9a647d4c72b..657d00b4fc5 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs @@ -55,6 +55,7 @@ public string LiteralPath /// [Parameter] [ValidateNotNullOrEmpty] + [ArgumentCompleter(typeof(ScopeArgumentCompleter))] public string Scope { get; set; } /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs index cd0c4fce327..15c48efd847 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs @@ -25,6 +25,7 @@ public class RemoveAliasCommand : PSCmdlet /// The scope parameter for the command determines which scope the alias is removed from. /// [Parameter] + [ArgumentCompleter(typeof(ScopeArgumentCompleter))] public string Scope { get; set; } /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs index 6df552ab8e8..85bdd2b02d2 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs @@ -22,6 +22,7 @@ public abstract class VariableCommandBase : PSCmdlet /// [Parameter] [ValidateNotNullOrEmpty] + [ArgumentCompleter(typeof(ScopeArgumentCompleter))] public string Scope { get; set; } #endregion parameters diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteAliasCommandBase.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteAliasCommandBase.cs index 82c9c9f6557..31670935fcf 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteAliasCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteAliasCommandBase.cs @@ -61,6 +61,7 @@ public SwitchParameter PassThru /// The scope parameter for the command determines which scope the alias is set in. /// [Parameter] + [ArgumentCompleter(typeof(ScopeArgumentCompleter))] public string Scope { get; set; } /// diff --git a/src/System.Management.Automation/engine/CommandCompletion/ScopeArgumentCompleter.cs b/src/System.Management.Automation/engine/CommandCompletion/ScopeArgumentCompleter.cs new file mode 100644 index 00000000000..b397be3aa5f --- /dev/null +++ b/src/System.Management.Automation/engine/CommandCompletion/ScopeArgumentCompleter.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System.Collections; +using System.Collections.Generic; +using System.Management.Automation.Language; + +namespace System.Management.Automation +{ + /// + /// Provides argument completion for Scope parameter. + /// + public class ScopeArgumentCompleter : IArgumentCompleter + { + private static readonly string[] s_Scopes = new string[] { "Global", "Local", "Script" }; + + /// + /// Returns completion results for scope parameter. + /// + /// The command name. + /// The parameter name. + /// The word to complete. + /// The command AST. + /// The fake bound parameters. + /// List of completion results. + public IEnumerable CompleteArgument( + string commandName, + string parameterName, + string wordToComplete, + CommandAst commandAst, + IDictionary fakeBoundParameters) + { + var scopePattern = WildcardPattern.Get(wordToComplete + "*", WildcardOptions.IgnoreCase); + + foreach (string scope in s_Scopes) + { + if (scopePattern.IsMatch(scope)) + { + yield return new CompletionResult(scope); + } + } + } + } +} diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index 0b03155be3a..7e72b3fff08 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -744,6 +744,32 @@ ConstructorTestClass(int i, bool b) $res.CompletionMatches[0].CompletionText | Should -BeExactly '$TestVar1' } + Context 'Scope parameter completion' { + BeforeAll { + $allScopes = 'Global Local Script' + $globalScope = 'Global' + $localScope = 'Local' + $scriptScope = 'Script' + $allScopeCommands = 'Clear-Variable', 'Export-Alias', 'Get-Alias', 'Get-PSDrive', 'Get-Variable', 'Import-Alias', 'New-Alias', 'New-PSDrive', 'New-Variable', 'Remove-Alias', 'Remove-PSDrive', 'Remove-Variable', 'Set-Alias', 'Set-Variable' + } + + It "Should complete '' for ''" -TestCases @( + @{ Commands = $allScopeCommands; ParameterInput = "-Scope "; ExpectedScopes = $allScopes } + @{ Commands = $allScopeCommands; ParameterInput = "-Scope G"; ExpectedScopes = $globalScope } + @{ Commands = $allScopeCommands; ParameterInput = "-Scope Lo"; ExpectedScopes = $localScope } + @{ Commands = $allScopeCommands; ParameterInput = "-Scope Scr"; ExpectedScopes = $scriptScope } + @{ Commands = $allScopeCommands; ParameterInput = "-Scope NonExistentScope"; ExpectedScopes = '' } + ) { + param($Commands, $ParameterInput, $ExpectedScopes) + foreach ($command in $Commands) { + $joinedCommand = "$command $ParameterInput" + $res = TabExpansion2 -inputScript $joinedCommand -cursorColumn $joinedCommand.Length + $completionText = $res.CompletionMatches.CompletionText | Sort-Object + $completionText -join ' ' | Should -BeExactly $ExpectedScopes + } + } + } + Context 'Get-Verb & Get-Command -Verb parameter completion' { BeforeAll { $allVerbs = 'Add Approve Assert Backup Block Build Checkpoint Clear Close Compare Complete Compress Confirm Connect Convert ConvertFrom ConvertTo Copy Debug Deny Deploy Disable Disconnect Dismount Edit Enable Enter Exit Expand Export Find Format Get Grant Group Hide Import Initialize Install Invoke Join Limit Lock Measure Merge Mount Move New Open Optimize Out Ping Pop Protect Publish Push Read Receive Redo Register Remove Rename Repair Request Reset Resize Resolve Restart Restore Resume Revoke Save Search Select Send Set Show Skip Split Start Step Stop Submit Suspend Switch Sync Test Trace Unblock Undo Uninstall Unlock Unprotect Unpublish Unregister Update Use Wait Watch Write' From 2ad03151f8c48c3a144d9af51ed569eff2abe4ea Mon Sep 17 00:00:00 2001 From: Armaan Mcleod Date: Wed, 20 Dec 2023 03:18:04 +1100 Subject: [PATCH 0183/1168] Add `-Verb` argument completer for `Start-Process` (#20415) --- .../commands/management/Process.cs | 92 +++++++++++++++++++ .../TabCompletion/TabCompletion.Tests.ps1 | 40 ++++++++ 2 files changed, 132 insertions(+) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs index 2dc487d0e33..1d877ed5a21 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs @@ -4,6 +4,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Collections.Specialized; using System.ComponentModel; // Win32Exception using System.Diagnostics; // Process class @@ -11,6 +12,7 @@ using System.IO; using System.Management.Automation; using System.Management.Automation.Internal; +using System.Management.Automation.Language; using System.Net; using System.Runtime.InteropServices; using System.Runtime.Serialization; @@ -1800,6 +1802,7 @@ public string RedirectStandardOutput /// [Parameter(ParameterSetName = "UseShellExecute")] [ValidateNotNullOrEmpty] + [ArgumentCompleter(typeof(VerbArgumentCompleter))] public string Verb { get; set; } /// @@ -2656,6 +2659,95 @@ private Process StartWithShellExecute(ProcessStartInfo startInfo) #endregion } + /// + /// Provides argument completion for Verb parameter. + /// + public class VerbArgumentCompleter : IArgumentCompleter + { + /// + /// Returns completion results for verb parameter. + /// + /// The command name. + /// The parameter name. + /// The word to complete. + /// The command AST. + /// The fake bound parameters. + /// List of Completion Results. + public IEnumerable CompleteArgument( + string commandName, + string parameterName, + string wordToComplete, + CommandAst commandAst, + IDictionary fakeBoundParameters) + { + // -Verb is not supported on non-Windows platforms as well as Windows headless SKUs + if (!Platform.IsWindowsDesktop) + { + yield break; + } + + // Completion: Start-Process -FilePath -Verb + if (commandName.Equals("Start-Process", StringComparison.OrdinalIgnoreCase) + && fakeBoundParameters.Contains("FilePath")) + { + string filePath = fakeBoundParameters["FilePath"].ToString(); + + // Complete file verbs if extension exists + if (Path.HasExtension(filePath)) + { + foreach (string verb in CompleteFileVerbs(filePath, wordToComplete)) + { + yield return new CompletionResult(verb); + } + + yield break; + } + + // Otherwise check if command is an Application to resolve executable full path with extension + // e.g if powershell was given, resolve to powershell.exe to get verbs + using var ps = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace); + + var commandInfo = new CmdletInfo("Get-Command", typeof(GetCommandCommand)); + + ps.AddCommand(commandInfo); + ps.AddParameter("Name", filePath); + ps.AddParameter("CommandType", CommandTypes.Application); + + Collection commands = ps.Invoke(); + + // Start-Process & Get-Command select first found application based on PATHEXT environment variable + if (commands.Count >= 1) + { + foreach (string verb in CompleteFileVerbs(commands[0].Source, wordToComplete)) + { + yield return new CompletionResult(verb); + } + } + } + } + + /// + /// Completes file verbs. + /// + /// The file path to get verbs. + /// The word to complete. + /// List of file verbs to complete. + private static IEnumerable CompleteFileVerbs(string filePath, string wordToComplete) + { + var verbPattern = WildcardPattern.Get(wordToComplete + "*", WildcardOptions.IgnoreCase); + + string[] verbs = new ProcessStartInfo(filePath).Verbs; + + foreach (string verb in verbs) + { + if (verbPattern.IsMatch(verb)) + { + yield return verb; + } + } + } + } + #if !UNIX /// /// ProcessCollection is a helper class used by Start-Process -Wait cmdlet to monitor the diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index 7e72b3fff08..27b6135cf5d 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -744,6 +744,46 @@ ConstructorTestClass(int i, bool b) $res.CompletionMatches[0].CompletionText | Should -BeExactly '$TestVar1' } + Context 'Start-Process -Verb parameter completion' { + BeforeAll { + function GetProcessInfoVerbs($path) { + (New-Object -TypeName System.Diagnostics.ProcessStartInfo -ArgumentList $path).Verbs + } + + $cmdPath = Join-Path -Path $TestDrive -ChildPath 'test.cmd' + $cmdVerbs = GetProcessInfoVerbs $cmdPath + $exePath = Join-Path -Path $TestDrive -ChildPath 'test.exe' + $exeVerbs = GetProcessInfoVerbs $exePath + $exeVerbsStartingWithRun = $exeVerbs | Where-Object { $_ -like 'run*' } + $powerShellExeWithNoExtension = 'powershell' + $txtPath = Join-Path -Path $TestDrive -ChildPath 'test.txt' + $txtVerbs = GetProcessInfoVerbs $txtPath + $wavPath = Join-Path -Path $TestDrive -ChildPath 'test.wav' + $wavVerbs = GetProcessInfoVerbs $wavPath + $docxPath = Join-Path -Path $TestDrive -ChildPath 'test.docx' + $docxVerbs = GetProcessInfoVerbs $docxPath + $fileWithNoExtensionPath = Join-Path -Path $TestDrive -ChildPath 'test' + $fileWithNoExtensionVerbs = GetProcessInfoVerbs $fileWithNoExtensionPath + } + + It "Should complete Verb parameter for ''" -Skip:(!([System.Management.Automation.Platform]::IsWindowsDesktop)) -TestCases @( + @{ TextInput = 'Start-Process -Verb '; ExpectedVerbs = '' } + @{ TextInput = "Start-Process -FilePath $cmdPath -Verb "; ExpectedVerbs = $cmdVerbs -join ' ' } + @{ TextInput = "Start-Process -FilePath $exePath -Verb "; ExpectedVerbs = $exeVerbs -join ' ' } + @{ TextInput = "Start-Process -FilePath $exePath -Verb run"; ExpectedVerbs = $exeVerbsStartingWithRun -join ' ' } + @{ TextInput = "Start-Process -FilePath $powerShellExeWithNoExtension -Verb "; ExpectedVerbs = $exeVerbs -join ' ' } + @{ TextInput = "Start-Process -FilePath $txtPath -Verb "; ExpectedVerbs = $txtVerbs -join ' ' } + @{ TextInput = "Start-Process -FilePath $wavPath -Verb "; ExpectedVerbs = $wavVerbs -join ' ' } + @{ TextInput = "Start-Process -FilePath $docxPath -Verb "; ExpectedVerbs = $docxVerbs -join ' ' } + @{ TextInput = "Start-Process -FilePath $fileWithNoExtensionPath -Verb "; ExpectedVerbs = $fileWithNoExtensionVerbs -join ' ' } + ) { + param($TextInput, $ExpectedVerbs) + $res = TabExpansion2 -inputScript $TextInput -cursorColumn $TextInput.Length + $completionText = $res.CompletionMatches.CompletionText | Sort-Object + $completionText -join ' ' | Should -BeExactly $ExpectedVerbs + } + } + Context 'Scope parameter completion' { BeforeAll { $allScopes = 'Global Local Script' From 103c945c325328ac37d441488bcd6a38adf43888 Mon Sep 17 00:00:00 2001 From: Armaan Mcleod Date: Thu, 21 Dec 2023 04:32:57 +1100 Subject: [PATCH 0184/1168] Fix `-OlderThan`/`-NewerThan` parameters for `Test-Path` when using `PathType` and date range (#20942) --- .../commands/management/TestPathCommand.cs | 14 ++-- .../namespaces/FileSystemProvider.cs | 4 +- .../Test-Path.Tests.ps1 | 71 +++++++++++++++++++ 3 files changed, 78 insertions(+), 11 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestPathCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestPathCommand.cs index 04e6f36a8c3..d8748b6ef9c 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestPathCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestPathCommand.cs @@ -136,7 +136,7 @@ internal override object GetDynamicParameters(CmdletProviderContext context) { object result = null; - if (this.PathType == TestPathType.Any && !IsValid) + if (!IsValid) { if (Path != null && Path.Length > 0 && Path[0] != null) { @@ -212,19 +212,15 @@ protected override void ProcessRecord() } else { + result = InvokeProvider.Item.Exists(path, currentContext); + if (this.PathType == TestPathType.Container) { - result = InvokeProvider.Item.IsContainer(path, currentContext); + result &= InvokeProvider.Item.IsContainer(path, currentContext); } else if (this.PathType == TestPathType.Leaf) { - result = - InvokeProvider.Item.Exists(path, currentContext) && - !InvokeProvider.Item.IsContainer(path, currentContext); - } - else - { - result = InvokeProvider.Item.Exists(path, currentContext); + result &= !InvokeProvider.Item.IsContainer(path, currentContext); } } } diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 9337b466805..85aa744dbb0 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -3319,12 +3319,12 @@ private bool ItemExists(string path, out ErrorRecord error) if (itemExistsDynamicParameters.OlderThan.HasValue) { - result = lastWriteTime < itemExistsDynamicParameters.OlderThan.Value; + result &= lastWriteTime < itemExistsDynamicParameters.OlderThan.Value; } if (itemExistsDynamicParameters.NewerThan.HasValue) { - result = lastWriteTime > itemExistsDynamicParameters.NewerThan.Value; + result &= lastWriteTime > itemExistsDynamicParameters.NewerThan.Value; } } } 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 edad763fe71..cbbf36a98bc 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Path.Tests.ps1 @@ -12,6 +12,24 @@ Describe "Test-Path" -Tags "CI" { $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 + + $today = Get-Date + $oneDayOld = (Get-Date).AddDays(-1) + $twoDaysOld = (Get-Date).AddDays(-2) + + $oldFilePath = Join-Path -Path $testdirectory -ChildPath oldfile + $oldFile = New-Item -Path $oldFilePath -ItemType File + $oldFile.LastWriteTime = $oneDayOld + + $oldDirPath = Join-Path -Path $testdirectory -ChildPath olddir + $oldDir = New-Item -Path $oldDirPath -ItemType Directory + $oldDir.LastWriteTime = $oneDayOld + + $newFilePath = Join-Path -Path $testdirectory -ChildPath newfile + New-Item -Path $newFilePath -ItemType File | Out-Null + + $newDirPath = Join-Path -Path $testdirectory -ChildPath newdir + New-Item -Path $newDirPath -ItemType Directory | Out-Null } It "Should be called on an existing path without error" { @@ -141,4 +159,57 @@ Describe "Test-Path" -Tags "CI" { Test-Path Env:\PATH | Should -BeTrue } + It "Should return true if NewerThan is used and path is newer than one day" { + Test-Path -Path $newFilePath -PathType Leaf -NewerThan $oneDayOld | Should -BeTrue + Test-Path -Path $newDirPath -PathType Container -NewerThan $oneDayOld | Should -BeTrue + Test-Path -Path $newFilePath -PathType Any -NewerThan $oneDayOld | Should -BeTrue + Test-Path -Path $newDirPath -PathType Any -NewerThan $oneDayOld | Should -BeTrue + Test-Path -Path $newFilePath -NewerThan $oneDayOld | Should -BeTrue + Test-Path -Path $newDirPath -NewerThan $oneDayOld | Should -BeTrue + } + + It "Should return false if NewerThan is used and path is not newer than today" { + Test-Path -Path $oldFilePath -PathType Leaf -NewerThan $today | Should -BeFalse + Test-Path -Path $oldDirPath -PathType Container -NewerThan $today | Should -BeFalse + Test-Path -Path $oldFilePath -PathType Any -NewerThan $today | Should -BeFalse + Test-Path -Path $oldDirPath -PathType Any -NewerThan $today | Should -BeFalse + Test-Path -Path $oldFilePath -NewerThan $today | Should -BeFalse + Test-Path -Path $oldDirPath -NewerThan $today | Should -BeFalse + } + + It "Should return true if OlderThan is used and path is older than today" { + Test-Path -Path $oldFilePath -PathType Leaf -OlderThan $today | Should -BeTrue + Test-Path -Path $oldDirPath -PathType Container -OlderThan $today | Should -BeTrue + Test-Path -Path $oldFilePath -PathType Any -OlderThan $today | Should -BeTrue + Test-Path -Path $oldDirPath -PathType Any -OlderThan $today | Should -BeTrue + Test-Path -Path $oldFilePath -OlderThan $today | Should -BeTrue + Test-Path -Path $oldDirPath -OlderThan $today | Should -BeTrue + } + + It "Should return false if OlderThan is used and path is not older than one day" { + Test-Path -Path $newFilePath -PathType Leaf -OlderThan $oneDayOld | Should -BeFalse + Test-Path -Path $newDirPath -PathType Container -OlderThan $oneDayOld | Should -BeFalse + Test-Path -Path $newFilePath -PathType Any -OlderThan $oneDayOld | Should -BeFalse + Test-Path -Path $newDirPath -PathType Any -OlderThan $oneDayOld | Should -BeFalse + Test-Path -Path $newFilePath -OlderThan $oneDayOld | Should -BeFalse + Test-Path -Path $newDirPath -OlderThan $oneDayOld | Should -BeFalse + } + + It "Should return true if OlderThan and NewerThan is used together and path exists in date range" { + Test-Path -Path $oldFilePath -PathType Leaf -NewerThan $twoDaysOld -OlderThan $today | Should -BeTrue + Test-Path -Path $oldDirPath -PathType Container -NewerThan $twoDaysOld -OlderThan $today | Should -BeTrue + Test-Path -Path $oldFilePath -PathType Any -NewerThan $twoDaysOld -OlderThan $today | Should -BeTrue + Test-Path -Path $oldDirPath -PathType Any -NewerThan $twoDaysOld -OlderThan $today | Should -BeTrue + Test-Path -Path $oldFilePath -NewerThan $twoDaysOld -OlderThan $today | Should -BeTrue + Test-Path -Path $oldDirPath -NewerThan $twoDaysOld -OlderThan $today | Should -BeTrue + } + + It "Should return false if OlderThan and NewerThan is used together and path does not exist in date range" { + Test-Path -Path $newFilePath -PathType Leaf -NewerThan $twoDaysOld -OlderThan $oneDayOld | Should -BeFalse + Test-Path -Path $newDirPath -PathType Container -NewerThan $twoDaysOld -OlderThan $oneDayOld | Should -BeFalse + Test-Path -Path $newFilePath -PathType Any -NewerThan $twoDaysOld -OlderThan $oneDayOld | Should -BeFalse + Test-Path -Path $newDirPath -PathType Any -NewerThan $twoDaysOld -OlderThan $oneDayOld | Should -BeFalse + Test-Path -Path $newFilePath -NewerThan $twoDaysOld -OlderThan $oneDayOld | Should -BeFalse + Test-Path -Path $newDirPath -NewerThan $twoDaysOld -OlderThan $oneDayOld | Should -BeFalse + } } From 1b98bb0815e549e0d0351e576aa3c7cfeadf90d1 Mon Sep 17 00:00:00 2001 From: Armaan Mcleod Date: Thu, 21 Dec 2023 19:06:17 +1100 Subject: [PATCH 0185/1168] Added `-Module` completion for `Save-Help`/`Update-Help` commands (#20678) --- .../CommandCompletion/CompletionCompleters.cs | 61 +++++++++++++------ .../TabCompletion/TabCompletion.Tests.ps1 | 26 ++++++++ 2 files changed, 67 insertions(+), 20 deletions(-) diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index 357ce126ab5..78fac731f89 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -2185,6 +2185,22 @@ private static void NativeCommandArgumentCompletion( NativeCompletionGetHelpCommand(context, parameterName, /* isHelpRelated: */ true, result); break; } + case "Save-Help": + { + if (parameterName.Equals("Module", StringComparison.OrdinalIgnoreCase)) + { + CompleteModule(context, result); + } + break; + } + case "Update-Help": + { + if (parameterName.Equals("Module", StringComparison.OrdinalIgnoreCase)) + { + CompleteModule(context, result); + } + break; + } case "Invoke-Expression": { if (parameterName.Equals("Command", StringComparison.OrdinalIgnoreCase)) @@ -3032,37 +3048,42 @@ private static void NativeCompletionGetCommand(CompletionContext context, string } else if (!string.IsNullOrEmpty(paramName) && paramName.Equals("Module", StringComparison.OrdinalIgnoreCase)) { - RemoveLastNullCompletionResult(result); + CompleteModule(context, result); + } + } - var modules = new HashSet(StringComparer.OrdinalIgnoreCase); - var moduleResults = CompleteModuleName(context, loadedModulesOnly: true); - if (moduleResults != null) + private static void CompleteModule(CompletionContext context, List result) + { + RemoveLastNullCompletionResult(result); + + var modules = new HashSet(StringComparer.OrdinalIgnoreCase); + var moduleResults = CompleteModuleName(context, loadedModulesOnly: true); + if (moduleResults != null) + { + foreach (CompletionResult moduleResult in moduleResults) { - foreach (CompletionResult moduleResult in moduleResults) + if (!modules.Contains(moduleResult.ToolTip)) { - if (!modules.Contains(moduleResult.ToolTip)) - { - modules.Add(moduleResult.ToolTip); - result.Add(moduleResult); - } + modules.Add(moduleResult.ToolTip); + result.Add(moduleResult); } } + } - moduleResults = CompleteModuleName(context, loadedModulesOnly: false); - if (moduleResults != null) + moduleResults = CompleteModuleName(context, loadedModulesOnly: false); + if (moduleResults != null) + { + foreach (CompletionResult moduleResult in moduleResults) { - foreach (CompletionResult moduleResult in moduleResults) + if (!modules.Contains(moduleResult.ToolTip)) { - if (!modules.Contains(moduleResult.ToolTip)) - { - modules.Add(moduleResult.ToolTip); - result.Add(moduleResult); - } + modules.Add(moduleResult.ToolTip); + result.Add(moduleResult); } } - - result.Add(CompletionResult.Null); } + + result.Add(CompletionResult.Null); } private static void NativeCompletionGetHelpCommand(CompletionContext context, string paramName, bool isHelpRelated, List result) diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index 27b6135cf5d..b92a436e441 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -885,6 +885,32 @@ ConstructorTestClass(int i, bool b) } } + Context 'Help Module parameter completion' { + BeforeAll { + $utilityModule = 'Microsoft.PowerShell.Utility' + $managementModule = 'Microsoft.PowerShell.Management' + $allMicrosoftPowerShellModules = (Get-Module -Name Microsoft.PowerShell* -ListAvailable).Name + Import-Module -Name $allMicrosoftPowerShellModules -ErrorAction SilentlyContinue + $allMicrosoftPowerShellModules = ($allMicrosoftPowerShellModules | Sort-Object -Unique) -join ' ' + } + + It "Should complete Module for ''" -TestCases @( + @{ TextInput = "Save-Help -Module Microsoft.PowerShell.U"; ExpectedModules = $utilityModule } + @{ TextInput = "Update-Help -Module Microsoft.PowerShell.U"; ExpectedModules = $utilityModule } + @{ TextInput = "Save-Help -Module Microsoft.PowerShell.Man"; ExpectedModules = $managementModule } + @{ TextInput = "Update-Help -Module Microsoft.PowerShell.Man"; ExpectedModules = $managementModule } + @{ TextInput = "Save-Help -Module Microsoft.Powershell"; ExpectedModules = $allMicrosoftPowerShellModules } + @{ TextInput = "Update-Help -Module Microsoft.PowerShell"; ExpectedModules = $allMicrosoftPowerShellModules } + @{ TextInput = "Save-Help -Module NonExistentModulePrefix"; ExpectedModules = '' } + @{ TextInput = "Update-Help -Module NonExistentModulePrefix"; ExpectedModules = '' } + ) { + param($TextInput, $ExpectedModules) + $res = TabExpansion2 -inputScript $TextInput -cursorColumn $TextInput.Length + $completionText = $res.CompletionMatches.CompletionText | Sort-Object -Unique + $completionText -join ' ' | Should -BeExactly $ExpectedModules + } + } + Context "Format cmdlet's View paramter completion" { BeforeAll { $viewDefinition = @' From 71ae6070c2ecfa27e4103894331ea94c616e6921 Mon Sep 17 00:00:00 2001 From: dxk3355 Date: Thu, 21 Dec 2023 12:28:36 -0500 Subject: [PATCH 0186/1168] Test-FileCatalog changes to use File.OpenRead to better handle when the file is executing or open Fix #20703 (#20939) --- .../security/CatalogHelper.cs | 2 +- .../FileCatalog.Tests.ps1 | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/System.Management.Automation/security/CatalogHelper.cs b/src/System.Management.Automation/security/CatalogHelper.cs index 405e8baa384..e815d73e045 100644 --- a/src/System.Management.Automation/security/CatalogHelper.cs +++ b/src/System.Management.Automation/security/CatalogHelper.cs @@ -423,7 +423,7 @@ internal static string CalculateFileHash(string filePath, string hashAlgorithm) FileStream fileStream; try { - fileStream = File.Open(filePath, FileMode.Open, FileAccess.Read); + fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read); } catch (Exception e) { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 index b187dbb43e1..78775bdb1ff 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 @@ -416,6 +416,52 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { $catalogPath | Should -Not -Exist } } + + Context "TestCatalog Executing File Validation Tests"{ + + AfterEach { + Remove-Item "$script:catalogPath" -Force -ErrorAction SilentlyContinue + } + + It "Test-FileCatalog should pass when target file is an executing process" { + $processFolder = (Get-Process -Id $pid).Path + $script:catalogPath = "$env:TEMP\TestCatalogExecutingFileValidation.cat" + $null = New-FileCatalog -Path "$processFolder" -CatalogFilePath $script:catalogPath -CatalogVersion 2 + $result = Test-FileCatalog -Path "$processFolder" -CatalogFilePath $script:catalogPath + $result | Should -Be "Valid" + } + } + + Context "TestCatalog File Open Validation Tests" { + + BeforeEach { + $null = New-Item -ItemType Directory -Path "$env:TEMP\testCatalog" -Force -ErrorAction SilentlyContinue + Set-Content -PassThru "$env:TEMP\testCatalog\test.txt" -Value "Test Data" | Out-Null + } + + AfterEach { + Remove-Item "$script:catalogPath" -Force -ErrorAction SilentlyContinue + Remove-Item "$env:TEMP\testCatalog" -Recurse -Force -ErrorAction SilentlyContinue + } + + it "Test-FileCatalog should pass when target file has an open reader with FileMode Open FileAccess Read and FileShare " -TestCases @( + @{ Name = "Read"; fileShareParameter = [System.IO.FileShare]::Read } + @{ Name = "ReadWrite"; fileShareParameter = [System.IO.FileShare]::ReadWrite } + ) { + param($name, [System.IO.FileShare] $fileShareParameter) + + $script:catalogPath = "$env:TEMP\TestCatalogFileOpenValidation.cat" + $null = New-FileCatalog -Path "$env:TEMP\testCatalog\" -CatalogFilePath $script:catalogPath -CatalogVersion 2 + $fileStream = [System.IO.File]::Open("$env:TEMP\testCatalog\test.txt", [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read, $fileShareParameter) + try { + $result = Test-FileCatalog -Path "$env:TEMP\testCatalog\" -CatalogFilePath $script:catalogPath + $result | Should -Be "Valid" + } finally { + $fileStream.Close() + $fileStream.Dispose() + } + } + } } } finally { From 57b1c741b8f64d17affcc8f90194ec3f8a4c307d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 11:30:39 +0500 Subject: [PATCH 0187/1168] Bump xunit from 2.6.3 to 2.6.4 (#20967) Bumps [xunit](https://github.com/xunit/xunit) from 2.6.3 to 2.6.4. - [Commits](https://github.com/xunit/xunit/compare/2.6.3...2.6.4) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- 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 c8d2314d77a..b5b8e30fc9c 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -23,7 +23,7 @@ - + From 4200af132836747a786bf0c5ec28c985aa1b522d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 11:31:11 +0500 Subject: [PATCH 0188/1168] Bump xunit.runner.visualstudio from 2.5.5 to 2.5.6 (#20966) Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.5.5 to 2.5.6. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.5...2.5.6) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- 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 b5b8e30fc9c..15c9aec0a0a 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -25,7 +25,7 @@ - + From 5282c9bb91674c6c67bcfba0593c4a33ab072fb3 Mon Sep 17 00:00:00 2001 From: Chris Dent <134605137+chrisdent-de@users.noreply.github.com> Date: Thu, 4 Jan 2024 18:42:41 +0000 Subject: [PATCH 0189/1168] Add Import-LocalizedData implicit Localization fallback (#19896) * Adds culture fallback to Import-LocalizedData * Only add fallback if current culture is not en-US * Pester 4 compatibility * Missing param block in It * Missed param block for It * Skip UICulture name test for Linux and Mac * Removed test fragment --- .../commands/utility/Import-LocalizedData.cs | 33 ++- .../Language/Scripting/I18n.Tests.ps1 | 181 ----------------- .../Scripting/I18n.Tests_fallback.psd1 | 5 - .../Language/Scripting/I18n/I18n.Tests.ps1 | 192 ++++++++++++++++++ .../Language/Scripting/I18n/I18n.Tests.psd1 | 4 + .../I18n/I18n_altbase/en-US/I18n.Tests.psd1 | 4 + .../I18n_altbase/en-US/I18n_altfilename.psd1 | 4 + .../I18n/I18n_altbase/fr-FR/I18n.Tests.psd1 | 4 + .../I18n_altbase/fr-FR/I18n_altfilename.psd1 | 4 + .../I18n/I18n_supportedcommands.psd1 | 1 + .../{ => I18n}/en-US/I18n.Tests.psd1 | 4 +- .../I18n/en-US/I18n_altfilename.psd1 | 4 + .../Scripting/I18n/en/I18n.Tests.psd1 | 4 + .../Scripting/I18n/fr-FR/I18n.Tests.psd1 | 4 + .../I18n/fr-FR/I18n_altfilename.psd1 | 4 + .../Language/Scripting/en-US/bad.psd1 | 7 - .../Language/Scripting/en-US/foo.psd1 | 4 - .../Language/Scripting/en-US/if.psd1 | 7 - .../Language/Scripting/fr-FR/I18n.Tests.psd1 | 4 - .../Language/Scripting/fr-FR/foo.psd1 | 4 - .../Scripting/newbase/en-US/I18n.Tests.psd1 | 4 - .../Language/Scripting/newbase/en-US/foo.psd1 | 4 - .../Scripting/newbase/fr-FR/I18n.Tests.psd1 | 4 - .../Language/Scripting/newbase/fr-FR/foo.psd1 | 4 - 24 files changed, 255 insertions(+), 239 deletions(-) delete mode 100644 test/powershell/Language/Scripting/I18n.Tests.ps1 delete mode 100644 test/powershell/Language/Scripting/I18n.Tests_fallback.psd1 create mode 100644 test/powershell/Language/Scripting/I18n/I18n.Tests.ps1 create mode 100644 test/powershell/Language/Scripting/I18n/I18n.Tests.psd1 create mode 100644 test/powershell/Language/Scripting/I18n/I18n_altbase/en-US/I18n.Tests.psd1 create mode 100644 test/powershell/Language/Scripting/I18n/I18n_altbase/en-US/I18n_altfilename.psd1 create mode 100644 test/powershell/Language/Scripting/I18n/I18n_altbase/fr-FR/I18n.Tests.psd1 create mode 100644 test/powershell/Language/Scripting/I18n/I18n_altbase/fr-FR/I18n_altfilename.psd1 create mode 100644 test/powershell/Language/Scripting/I18n/I18n_supportedcommands.psd1 rename test/powershell/Language/Scripting/{ => I18n}/en-US/I18n.Tests.psd1 (53%) create mode 100644 test/powershell/Language/Scripting/I18n/en-US/I18n_altfilename.psd1 create mode 100644 test/powershell/Language/Scripting/I18n/en/I18n.Tests.psd1 create mode 100644 test/powershell/Language/Scripting/I18n/fr-FR/I18n.Tests.psd1 create mode 100644 test/powershell/Language/Scripting/I18n/fr-FR/I18n_altfilename.psd1 delete mode 100644 test/powershell/Language/Scripting/en-US/bad.psd1 delete mode 100644 test/powershell/Language/Scripting/en-US/foo.psd1 delete mode 100644 test/powershell/Language/Scripting/en-US/if.psd1 delete mode 100644 test/powershell/Language/Scripting/fr-FR/I18n.Tests.psd1 delete mode 100644 test/powershell/Language/Scripting/fr-FR/foo.psd1 delete mode 100644 test/powershell/Language/Scripting/newbase/en-US/I18n.Tests.psd1 delete mode 100644 test/powershell/Language/Scripting/newbase/en-US/foo.psd1 delete mode 100644 test/powershell/Language/Scripting/newbase/fr-FR/I18n.Tests.psd1 delete mode 100644 test/powershell/Language/Scripting/newbase/fr-FR/foo.psd1 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 d69226babb1..1f43670531d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Import-LocalizedData.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Import-LocalizedData.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; @@ -290,7 +291,7 @@ private string GetFilePath() fileName = Path.GetFileNameWithoutExtension(fileName); - CultureInfo culture = null; + CultureInfo culture; if (_uiculture == null) { culture = CultureInfo.CurrentUICulture; @@ -307,19 +308,33 @@ private string GetFilePath() } } - CultureInfo currentCulture = culture; + List cultureList = new List { culture }; + if (_uiculture == null && culture.Name != "en-US") + { + // .NET 4.8 presents en-US as a parent of any current culture when accessed via the CurrentUICulture + // property. + // + // This feature is not present when GetCultureInfo is called, therefore this fallback change only + // applies when the UICulture parameter is not supplied. + cultureList.Add(CultureInfo.GetCultureInfo("en-US")); + } + string filePath; string fullFileName = fileName + ".psd1"; - while (currentCulture != null && !string.IsNullOrEmpty(currentCulture.Name)) + foreach (CultureInfo cultureToTest in cultureList) { - filePath = Path.Combine(dir, currentCulture.Name, fullFileName); - - if (File.Exists(filePath)) + CultureInfo currentCulture = cultureToTest; + while (currentCulture != null && !string.IsNullOrEmpty(currentCulture.Name)) { - return filePath; - } + filePath = Path.Combine(dir, currentCulture.Name, fullFileName); - currentCulture = currentCulture.Parent; + if (File.Exists(filePath)) + { + return filePath; + } + + currentCulture = currentCulture.Parent; + } } filePath = Path.Combine(dir, fullFileName); diff --git a/test/powershell/Language/Scripting/I18n.Tests.ps1 b/test/powershell/Language/Scripting/I18n.Tests.ps1 deleted file mode 100644 index 41855bffab9..00000000000 --- a/test/powershell/Language/Scripting/I18n.Tests.ps1 +++ /dev/null @@ -1,181 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -Describe 'Testing of script internationalization' -Tags "CI" { - BeforeAll { - $dir=$PSScriptRoot - $defaultParamValues = $PSDefaultParameterValues.Clone() - #This works only for en-US or fr-FR - if ($PSUICulture -ne 'en-US' -and $PSUICulture -ne 'fr-FR') - { - $PSDefaultParameterValues["It:Skip"] = $true - } - } - AfterAll { - $global:PSDefaultParameterValues = $defaultParamValues - } - - It 'convertFromString-Data should work with data statement.' { - - data mydata - { - ConvertFrom-StringData @' - string1=string1 - string2=string2 -'@ - } - - $mydata.string1 | Should -BeExactly 'string1' - $mydata.string2 | Should -BeExactly 'string2' - } - - It 'Import default culture is done correctly' { - - Import-LocalizedData mydata; - - $mydata.string1 | Should -BeExactly 'string1 for en-US' - $mydata.string2 | Should -BeExactly 'string2 for en-US' - } - - It 'Import specific culture(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 - - $mydata.string1 | Should -BeExactly 'string1 for fr-FR' - $mydata.string2 | Should -BeExactly 'string2 for fr-FR' - } - - It 'Import non existing culture is done correctly' { - - Import-LocalizedData mydata -UICulture nl-NL -ErrorAction SilentlyContinue -ErrorVariable ev - - $ev | Should -Not -BeNullOrEmpty - $ev[0].Exception | Should -BeOfType System.Management.Automation.PSInvalidOperationException - } - - It 'Import different file name is done correctly' { - - 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 - - $mydata.string1 | Should -BeExactly 'string1 from foo in fr-FR' - $mydata.string2 | Should -BeExactly 'string2 from foo in fr-FR' - } - - It 'Import different file base is done correctly' { - - 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 - - $mydata.string1 | Should -BeExactly 'string1 for fr-FR under newbase' - $mydata.string2 | Should -BeExactly 'string2 for fr-FR under newbase' - } - - It 'Import different file base and file name' { - - 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 - - $mydata.string1 | Should -BeExactly 'string1 for fr-FR from foo under newbase' - $mydata.string2 | Should -BeExactly 'string2 for fr-FR from foo under newbase' - } - - It "Import variable that doesn't exist" { - - Import-LocalizedData mydata2 - - $mydata2.string1 | Should -BeExactly 'string1 for en-US' - $mydata2.string2 | Should -BeExactly 'string2 for en-US' - } - - It 'Import bad psd1 file - tests the use of disallowed variables' { - - $script:exception = $null - & { - trap {$script:exception = $_ ; continue } - Import-LocalizedData mydata -FileName bad - } - - $script:exception.exception | Should -Not -BeNullOrEmpty - $script:exception.exception | Should -BeOfType System.management.automation.psinvalidoperationexception - } - - It 'Import if psd1 file is done correctly' { - - Import-LocalizedData mydata -FileName if - - if ($PSCulture -eq 'en-US') - { - $mydata.string1 | Should -BeExactly 'string1 for en-US in if' - $mydata.string2 | Should -BeExactly 'string2 for en-US in if' - } - else - { - $mydata | Should -BeNullOrEmpty - } - } - - $testData = @( - @{cmd = 'data d { @{ x=$(get-command)} }';Expected='get-command'}, - @{cmd = 'data d { if ($(get-command)) {} }';Expected='get-command'}, - @{cmd = 'data d { @(get-command) }';Expected='get-command'} - ) - - It 'Allowed cmdlets checked properly' -TestCase:$testData { - param ($cmd, $Expected) - - $script:exception = $null - & { - trap {$script:exception = $_.Exception ; continue } - Invoke-Expression $cmd - } - - $exception | Should -Match $Expected - } - - It 'Check alternate syntax that also supports complex variable names' { - - & { - $script:mydata = data { 123 } - } - $mydata | Should -Be 123 - - $mydata = data { 456 } - & { - # This import should not clobber the one at script scope - 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 - } - $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 - - 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/I18n.Tests_fallback.psd1 b/test/powershell/Language/Scripting/I18n.Tests_fallback.psd1 deleted file mode 100644 index f0a856fbd3a..00000000000 --- a/test/powershell/Language/Scripting/I18n.Tests_fallback.psd1 +++ /dev/null @@ -1,5 +0,0 @@ -MyConvertFrom-StringData @' -string1=fallback string1 for en-US -string2=fallback string2 for en-US -'@ -42 \ No newline at end of file diff --git a/test/powershell/Language/Scripting/I18n/I18n.Tests.ps1 b/test/powershell/Language/Scripting/I18n/I18n.Tests.ps1 new file mode 100644 index 00000000000..bb3506aa9ec --- /dev/null +++ b/test/powershell/Language/Scripting/I18n/I18n.Tests.ps1 @@ -0,0 +1,192 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +Describe 'Testing of script internationalization' -Tags 'CI' { + BeforeAll { + $testCultures = @( + @{ UICulture = 'en-US' } + @{ UICulture = 'fr-FR' } + ) + + $currentCulture = $PSUICulture + [System.Globalization.CultureInfo]::CurrentUICulture = 'en-US' + + $defaultParams = @{ + BindingVariable = 'data' + } + } + + BeforeEach { + Get-Variable -Name data -Scope Local -ErrorAction Ignore | Remove-Variable + } + + AfterAll { + [System.Globalization.CultureInfo]::CurrentUICulture = $currentCulture + } + + Context 'Data section' { + It 'ConvertFrom-StringData is permitted in a Data section' { + data dataVariable + { + ConvertFrom-StringData @' +string1=string1 +string2=string2 +'@ + } + + $dataVariable.string1 | Should -BeExactly 'string1' + $dataVariable.string2 | Should -BeExactly 'string2' + } + + It 'Throws an error if the data section contains a command which is not allowed' -TestCases @( + @{ Script = 'data d { @{ x=$(Get-Command)} }'; } + @{ Script = 'data d { if ($(Get-Command)) {} }' } + @{ Script = 'data d { @(Get-Command) }' } + ) { + param ( $Script ) + + { Invoke-Expression $Script } | Should -Throw -ErrorId 'CmdletNotInAllowedListForDataSection,Microsoft.PowerShell.Commands.InvokeExpressionCommand' + } + } + + Context 'BindingVariable parameter' { + It 'BindingVariable binds positionally' { + Import-LocalizedData data + + $data.string1 | Should -BeExactly 'string1 en-US' + $data.string2 | Should -BeExactly 'string2 en-US' + } + + It 'Imports data into the BindingVariable based on the current UICulture' { + Import-LocalizedData @defaultParams + + $data.string1 | Should -BeExactly 'string1 en-US' + $data.string2 | Should -BeExactly 'string2 en-US' + } + + It 'Does not clobber existing variables in a parent scope' { + $data = data { 456 } + & { + Import-LocalizedData @defaultParams + } + $data | Should -Be 456 + } + + It 'Replaces a BindingVariable in a parent scope if a scope modifier is specified' { + $Script:bindingVariable = data { 456 } + + $Script:bindingVariable | Should -Be 456 + + & { + Import-LocalizedData -BindingVariable Script:bindingVariable + } + + $Script:bindingVariable.string1 | Should -BeExactly 'string1 en-US' + } + } + + Context 'UICulture parameter' { + It 'Imports specific culture () defined by the UICulture parameter' -TestCases $testCultures { + param ( $UICulture ) + + [System.Globalization.CultureInfo]::CurrentUICulture = $UICulture + + Import-LocalizedData @defaultParams -UICulture $UICulture + + $data.string1 | Should -BeExactly ('string1 {0}' -f $UICulture) + $data.string2 | Should -BeExactly ('string2 {0}' -f $UICulture) + } + + It 'Throws an error if the specified UICulture does not exist' -Skip:(-not $IsWindows) { + { Import-LocalizedData @defaultParams -UICulture none-none -ErrorAction Stop } | + Should -Throw -ExceptionType 'System.Management.Automation.PSArgumentException' + } + } + + Context 'UICulture fallback' { + It 'When the UICulture parameter is specified, searches parent culture and current directory' -TestCases @( + @{ UICulture = 'en-US'; ExpectedString = 'en-US' } + @{ UICulture = 'en-GB'; ExpectedString = 'en' } + @{ UICulture = 'no-NL'; ExpectedString = 'fallback' } + ) { + param ( $UICulture, $ExpectedString ) + + [System.Globalization.CultureInfo]::CurrentUICulture = $UICulture + + $data = Import-LocalizedData -UICulture $UICulture + + $data.string1 | Should -Be ('string1 {0}' -f $ExpectedString) + $data.string2 | Should -Be ('string2 {0}' -f $ExpectedString) + } + + It 'When the UICulture parameter is not specified and no files exist falls back on en-US and parent cultures' -TestCases @( + @{ UICulture = 'no-NL'; ExpectedString = 'en-US' } + ) { + param ( $UICulture, $ExpectedString ) + + [System.Globalization.CultureInfo]::CurrentUICulture = $UICulture + + $data = Import-LocalizedData -FileName 'I18n_altfilename' + + $data.string1 | Should -Be ('string1 {0} I18n_altfilename' -f $ExpectedString) + $data.string2 | Should -Be ('string2 {0} I18n_altfilename' -f $ExpectedString) + } + } + + Context 'FileName and BaseDirectory parameters' { + BeforeAll { + $fileName = @{ FileName = 'I18n_altfilename' } + $baseDirectory = @{ BaseDirectory = Join-Path -Path $PSScriptRoot -ChildPath 'I18n_altbase' } + } + + It 'Imports from the "foo" file name when then FileName parameter is specified ()' -TestCases $testCultures { + param ( $UICulture ) + + [System.Globalization.CultureInfo]::CurrentUICulture = $UICulture + + Import-LocalizedData @defaultParams @fileName -UICulture $UICulture + + $data.string1 | Should -BeExactly ('string1 {0} I18n_altfilename' -f $UICulture) + $data.string2 | Should -BeExactly ('string2 {0} I18n_altfilename' -f $UICulture) + } + + It 'Imports from the "I18n_altfilename" directory when the BaseDirectory parameter is specified ()' -TestCases $testCultures { + param ( $UICulture ) + + [System.Globalization.CultureInfo]::CurrentUICulture = $UICulture + + Import-LocalizedData @defaultParams @baseDirectory -UICulture $UICulture + + $data.string1 | Should -BeExactly ('string1 {0} I18n_altbase' -f $UICulture) + $data.string2 | Should -BeExactly ('string2 {0} I18n_altbase' -f $UICulture) + } + + It 'Imports from the "I18n_altfilename" file name and "I18n_altbase" directory when both FileName and BaseDirectory are specified ()' -TestCases $testCultures { + param ( $UICulture ) + + [System.Globalization.CultureInfo]::CurrentUICulture = $UICulture + + Import-LocalizedData @defaultParams @fileName @baseDirectory -UICulture $UICulture + + $data.string1 | Should -BeExactly ('string1 {0} I18n_altbase I18n_altfilename' -f $UICulture) + $data.string2 | Should -BeExactly ('string2 {0} I18n_altbase I18n_altfilename' -f $UICulture) + } + + It 'Throws an error if the specified FileName does not exist in any path' { + { Import-LocalizedData @defaultParams -FileName doesNotExist -ErrorAction Stop } | + Should -Throw -ExceptionType 'System.Management.Automation.PSInvalidOperationException' + } + + It 'Throws an error if the specified BaseDirectory does not exist' { + { Import-LocalizedData @defaultParams -BaseDirectory "$PSScriptRoot\doesNotExist" -ErrorAction Stop } | + Should -Throw -ExceptionType 'System.Management.Automation.PSInvalidOperationException' + } + } + + Context 'SupportedCommand parameter' { + It 'Allows non-standard commands to be used in a data file' { + $data = Import-LocalizedData -FileName I18n_supportedcommands -SupportedCommand Get-Command + + $data.Name | Should -Be 'Import-LocalizedData' + } + } +} diff --git a/test/powershell/Language/Scripting/I18n/I18n.Tests.psd1 b/test/powershell/Language/Scripting/I18n/I18n.Tests.psd1 new file mode 100644 index 00000000000..13b8ef6b913 --- /dev/null +++ b/test/powershell/Language/Scripting/I18n/I18n.Tests.psd1 @@ -0,0 +1,4 @@ +ConvertFrom-StringData @' +string1=string1 fallback +string2=string2 fallback +'@ diff --git a/test/powershell/Language/Scripting/I18n/I18n_altbase/en-US/I18n.Tests.psd1 b/test/powershell/Language/Scripting/I18n/I18n_altbase/en-US/I18n.Tests.psd1 new file mode 100644 index 00000000000..64cfd8519f3 --- /dev/null +++ b/test/powershell/Language/Scripting/I18n/I18n_altbase/en-US/I18n.Tests.psd1 @@ -0,0 +1,4 @@ +ConvertFrom-StringData @' +string1=string1 en-US I18n_altbase +string2=string2 en-US I18n_altbase +'@ diff --git a/test/powershell/Language/Scripting/I18n/I18n_altbase/en-US/I18n_altfilename.psd1 b/test/powershell/Language/Scripting/I18n/I18n_altbase/en-US/I18n_altfilename.psd1 new file mode 100644 index 00000000000..cd128b07c6b --- /dev/null +++ b/test/powershell/Language/Scripting/I18n/I18n_altbase/en-US/I18n_altfilename.psd1 @@ -0,0 +1,4 @@ +ConvertFrom-StringData @' +string1=string1 en-US I18n_altbase I18n_altfilename +string2=string2 en-US I18n_altbase I18n_altfilename +'@ diff --git a/test/powershell/Language/Scripting/I18n/I18n_altbase/fr-FR/I18n.Tests.psd1 b/test/powershell/Language/Scripting/I18n/I18n_altbase/fr-FR/I18n.Tests.psd1 new file mode 100644 index 00000000000..8fdb5e82517 --- /dev/null +++ b/test/powershell/Language/Scripting/I18n/I18n_altbase/fr-FR/I18n.Tests.psd1 @@ -0,0 +1,4 @@ +ConvertFrom-StringData @' +string1=string1 fr-FR I18n_altbase +string2=string2 fr-FR I18n_altbase +'@ diff --git a/test/powershell/Language/Scripting/I18n/I18n_altbase/fr-FR/I18n_altfilename.psd1 b/test/powershell/Language/Scripting/I18n/I18n_altbase/fr-FR/I18n_altfilename.psd1 new file mode 100644 index 00000000000..b2df79cfc7a --- /dev/null +++ b/test/powershell/Language/Scripting/I18n/I18n_altbase/fr-FR/I18n_altfilename.psd1 @@ -0,0 +1,4 @@ +ConvertFrom-StringData @' +string1=string1 fr-FR I18n_altbase I18n_altfilename +string2=string2 fr-FR I18n_altbase I18n_altfilename +'@ diff --git a/test/powershell/Language/Scripting/I18n/I18n_supportedcommands.psd1 b/test/powershell/Language/Scripting/I18n/I18n_supportedcommands.psd1 new file mode 100644 index 00000000000..f0340702379 --- /dev/null +++ b/test/powershell/Language/Scripting/I18n/I18n_supportedcommands.psd1 @@ -0,0 +1 @@ +Get-Command Import-LocalizedData diff --git a/test/powershell/Language/Scripting/en-US/I18n.Tests.psd1 b/test/powershell/Language/Scripting/I18n/en-US/I18n.Tests.psd1 similarity index 53% rename from test/powershell/Language/Scripting/en-US/I18n.Tests.psd1 rename to test/powershell/Language/Scripting/I18n/en-US/I18n.Tests.psd1 index eca73623408..653cf133f78 100644 --- a/test/powershell/Language/Scripting/en-US/I18n.Tests.psd1 +++ b/test/powershell/Language/Scripting/I18n/en-US/I18n.Tests.psd1 @@ -1,4 +1,4 @@ ConvertFrom-StringData @' -string1=string1 for en-US -string2=string2 for en-US +string1=string1 en-US +string2=string2 en-US '@ # SIG # Begin signature block diff --git a/test/powershell/Language/Scripting/I18n/en-US/I18n_altfilename.psd1 b/test/powershell/Language/Scripting/I18n/en-US/I18n_altfilename.psd1 new file mode 100644 index 00000000000..0ffd5791cfb --- /dev/null +++ b/test/powershell/Language/Scripting/I18n/en-US/I18n_altfilename.psd1 @@ -0,0 +1,4 @@ +ConvertFrom-StringData @' +string1=string1 en-US I18n_altfilename +string2=string2 en-US I18n_altfilename +'@ diff --git a/test/powershell/Language/Scripting/I18n/en/I18n.Tests.psd1 b/test/powershell/Language/Scripting/I18n/en/I18n.Tests.psd1 new file mode 100644 index 00000000000..860bcf865ab --- /dev/null +++ b/test/powershell/Language/Scripting/I18n/en/I18n.Tests.psd1 @@ -0,0 +1,4 @@ +ConvertFrom-StringData @' +string1=string1 en +string2=string2 en +'@ # SIG # Begin signature block diff --git a/test/powershell/Language/Scripting/I18n/fr-FR/I18n.Tests.psd1 b/test/powershell/Language/Scripting/I18n/fr-FR/I18n.Tests.psd1 new file mode 100644 index 00000000000..c223067ac0e --- /dev/null +++ b/test/powershell/Language/Scripting/I18n/fr-FR/I18n.Tests.psd1 @@ -0,0 +1,4 @@ +ConvertFrom-StringData @' +string1=string1 fr-FR +string2=string2 fr-FR +'@ diff --git a/test/powershell/Language/Scripting/I18n/fr-FR/I18n_altfilename.psd1 b/test/powershell/Language/Scripting/I18n/fr-FR/I18n_altfilename.psd1 new file mode 100644 index 00000000000..1f7c446a725 --- /dev/null +++ b/test/powershell/Language/Scripting/I18n/fr-FR/I18n_altfilename.psd1 @@ -0,0 +1,4 @@ +ConvertFrom-StringData @' +string1=string1 fr-FR I18n_altfilename +string2=string2 fr-FR I18n_altfilename +'@ diff --git a/test/powershell/Language/Scripting/en-US/bad.psd1 b/test/powershell/Language/Scripting/en-US/bad.psd1 deleted file mode 100644 index b5e653ec66c..00000000000 --- a/test/powershell/Language/Scripting/en-US/bad.psd1 +++ /dev/null @@ -1,7 +0,0 @@ -if($a -eq 'en-US') -{ - ConvertFrom-StringData @' - string1=string1 from foo in en-US - string2=string2 from foo in en-US -'@ -} \ No newline at end of file diff --git a/test/powershell/Language/Scripting/en-US/foo.psd1 b/test/powershell/Language/Scripting/en-US/foo.psd1 deleted file mode 100644 index 6a82b0d1cb4..00000000000 --- a/test/powershell/Language/Scripting/en-US/foo.psd1 +++ /dev/null @@ -1,4 +0,0 @@ -ConvertFrom-StringData @' -string1=string1 from foo in en-US -string2=string2 from foo in en-US -'@ \ No newline at end of file diff --git a/test/powershell/Language/Scripting/en-US/if.psd1 b/test/powershell/Language/Scripting/en-US/if.psd1 deleted file mode 100644 index 1f139ae0e69..00000000000 --- a/test/powershell/Language/Scripting/en-US/if.psd1 +++ /dev/null @@ -1,7 +0,0 @@ -if($psculture -eq 'en-US') -{ - ConvertFrom-StringData @' - string1=string1 for en-US in if - string2=string2 for en-US in if -'@ -} \ No newline at end of file diff --git a/test/powershell/Language/Scripting/fr-FR/I18n.Tests.psd1 b/test/powershell/Language/Scripting/fr-FR/I18n.Tests.psd1 deleted file mode 100644 index 02c8a35512f..00000000000 --- a/test/powershell/Language/Scripting/fr-FR/I18n.Tests.psd1 +++ /dev/null @@ -1,4 +0,0 @@ -ConvertFrom-StringData @' -string1=string1 for fr-FR -string2=string2 for fr-FR -'@ \ No newline at end of file diff --git a/test/powershell/Language/Scripting/fr-FR/foo.psd1 b/test/powershell/Language/Scripting/fr-FR/foo.psd1 deleted file mode 100644 index ba1c90d3e66..00000000000 --- a/test/powershell/Language/Scripting/fr-FR/foo.psd1 +++ /dev/null @@ -1,4 +0,0 @@ -ConvertFrom-StringData @' -string1=string1 from foo in fr-FR -string2=string2 from foo in fr-FR -'@ \ No newline at end of file diff --git a/test/powershell/Language/Scripting/newbase/en-US/I18n.Tests.psd1 b/test/powershell/Language/Scripting/newbase/en-US/I18n.Tests.psd1 deleted file mode 100644 index 39611f8a0db..00000000000 --- a/test/powershell/Language/Scripting/newbase/en-US/I18n.Tests.psd1 +++ /dev/null @@ -1,4 +0,0 @@ -ConvertFrom-StringData @' -string1=string1 for en-US under newbase -string2=string2 for en-US under newbase -'@ \ No newline at end of file diff --git a/test/powershell/Language/Scripting/newbase/en-US/foo.psd1 b/test/powershell/Language/Scripting/newbase/en-US/foo.psd1 deleted file mode 100644 index c3ee32d9d9a..00000000000 --- a/test/powershell/Language/Scripting/newbase/en-US/foo.psd1 +++ /dev/null @@ -1,4 +0,0 @@ -ConvertFrom-StringData @' -string1=string1 for en-US from foo under newbase -string2=string2 for en-US from foo under newbase -'@ \ No newline at end of file diff --git a/test/powershell/Language/Scripting/newbase/fr-FR/I18n.Tests.psd1 b/test/powershell/Language/Scripting/newbase/fr-FR/I18n.Tests.psd1 deleted file mode 100644 index 2c4387d2e5f..00000000000 --- a/test/powershell/Language/Scripting/newbase/fr-FR/I18n.Tests.psd1 +++ /dev/null @@ -1,4 +0,0 @@ -ConvertFrom-StringData @' -string1=string1 for fr-FR under newbase -string2=string2 for fr-FR under newbase -'@ \ No newline at end of file diff --git a/test/powershell/Language/Scripting/newbase/fr-FR/foo.psd1 b/test/powershell/Language/Scripting/newbase/fr-FR/foo.psd1 deleted file mode 100644 index 2ddf5a07751..00000000000 --- a/test/powershell/Language/Scripting/newbase/fr-FR/foo.psd1 +++ /dev/null @@ -1,4 +0,0 @@ -ConvertFrom-StringData @' -string1=string1 for fr-FR from foo under newbase -string2=string2 for fr-FR from foo under newbase -'@ \ No newline at end of file From c3eedde84c22e98ee1dea86a2c7763cdd91e3218 Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Sun, 7 Jan 2024 14:32:57 +0900 Subject: [PATCH 0190/1168] Fix typo in remotingexceptions.cs (#21015) formating -> formatting --- .../engine/remoting/common/remotingexceptions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs b/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs index c7a2c561bd4..01c3d63c8d9 100644 --- a/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs +++ b/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs @@ -266,7 +266,7 @@ internal static class PSRemotingErrorInvariants /// This parameter holds the string in the resource file. /// /// - /// Optional parameters required by the resource string formating information. + /// Optional parameters required by the resource string formatting information. /// /// /// The formatted localized string. From 3dbd1c6c69f0859f30e4a1aeddf58b30189251d9 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Mon, 8 Jan 2024 09:40:55 -0800 Subject: [PATCH 0191/1168] Fix failures in GitHub action `markdown-link-check` (#20996) --- CHANGELOG/preview.md | 3 +++ docs/git/README.md | 18 ++++++++---------- docs/maintainers/releasing.md | 17 ++++++----------- tools/performance/README.md | 2 +- 4 files changed, 18 insertions(+), 22 deletions(-) create mode 100644 CHANGELOG/preview.md diff --git a/CHANGELOG/preview.md b/CHANGELOG/preview.md new file mode 100644 index 00000000000..28605544ff7 --- /dev/null +++ b/CHANGELOG/preview.md @@ -0,0 +1,3 @@ +# Preview Changelog + +Information about PowerShell previews will be found in this file diff --git a/docs/git/README.md b/docs/git/README.md index 817e4930f6c..b315727a647 100644 --- a/docs/git/README.md +++ b/docs/git/README.md @@ -13,9 +13,9 @@ git clone https://github.com/PowerShell/PowerShell.git --branch=master * Checkout a new local branch from `master` for every change you want to make (bugfix, feature). * Use lowercase-with-dashes for naming. * Follow [Linus' recommendations][Linus] about history. - - "People can (and probably should) rebase their _private_ trees (their own work). That's a _cleanup_. But never other peoples code. That's a 'destroy history'... - You must never EVER destroy other peoples history. You must not rebase commits other people did. - Basically, if it doesn't have your sign-off on it, it's off limits: you can't rebase it, because it's not yours." + * "People can (and probably should) rebase their _private_ trees (their own work). That's a _cleanup_. But never other peoples code. That's a 'destroy history'... + You must never EVER destroy other peoples history. You must not rebase commits other people did. + Basically, if it doesn't have your sign-off on it, it's off limits: you can't rebase it, because it's not yours." ### Understand branches @@ -23,12 +23,12 @@ git clone https://github.com/PowerShell/PowerShell.git --branch=master It could be unstable. * Send your pull requests to **master**. -### Sync your local repo +### Sync your local repository Use **git rebase** instead of **git merge** and **git pull**, when you're updating your feature-branch. ```sh -# fetch updates all remote branch references in the repo +# fetch updates all remote branch references in the repository # --all : tells it to do it for all remotes (handy, when you use your fork) # -p : tells it to remove obsolete remote branch references (when they are removed from remote) git fetch --all -p @@ -42,9 +42,7 @@ git rebase origin/master Covering all possible git scenarios is behind the scope of the current document. Git has excellent documentation and lots of materials available online. -We are leaving few links here: - -[Git pretty flowchart](http://justinhileman.info/article/git-pretty/): what to do, when your local repo became a mess. +We are leaving a few links here: [Linus]:https://wincent.com/wiki/git_rebase%3A_you're_doing_it_wrong @@ -57,12 +55,12 @@ you will find it via **tags**. * Find the tag that corresponds to the release. * Use `git checkout ` to get this version. -**Note:** [checking out a tag][tag] will move the repo to a [DETACHED HEAD][HEAD] state. +**Note:** [checking out a tag][tag] will move the repository to a [DETACHED HEAD][HEAD] state. [tag]:https://git-scm.com/book/en/v2/Git-Basics-Tagging#Checking-out-Tags [HEAD]:https://www.git-tower.com/learn/git/faq/detached-head-when-checkout-commit -If you want to make changes, based on tag's version (i.e. a hotfix), +If you want to make changes, based on tag's version (i.e. a hotfix), checkout a new branch from this DETACHED HEAD state. ```sh diff --git a/docs/maintainers/releasing.md b/docs/maintainers/releasing.md index a44ae5ee604..5aae87582c9 100644 --- a/docs/maintainers/releasing.md +++ b/docs/maintainers/releasing.md @@ -21,20 +21,15 @@ This is to help track the release preparation work. - Sign the MSI packages and DEB/RPM packages. - Install and verify the packages. 1. Update documentation, scripts and Dockerfiles - - Summarize the change log for the release. It should be reviewed by PM(s) to make it more user-friendly. - - Update [CHANGELOG.md](../../CHANGELOG.md) with the finalized change log draft. + - Summarize the changelog for the release. It should be reviewed by PM(s) to make it more user-friendly. + - Update [CHANGELOG.md](../../CHANGELOG.md) with the finalized changelog draft. - Update other documents and scripts to use the new package names and links. 1. Verify the release Dockerfiles. 1. [Create NuGet packages](#nuget-packages) and publish them to [powershell-core feed][ps-core-feed]. 1. [Create the release tag](#release-tag) and push the tag to `PowerShell/PowerShell` repository. -1. Create the draft and publish the release in Github. +1. Create the draft and publish the release in GitHub. 1. Merge the `release-` branch to `master` in `powershell/powershell` and delete the `release-` branch. 1. Publish Linux packages to Microsoft YUM/APT repositories. -1. Trigger the release docker builds for Linux and Windows container images. - - Linux: push a branch named `docker` to `powershell/powershell` repository to trigger the build at [powershell docker hub](https://hub.docker.com/r/microsoft/powershell/builds/). - Delete the `docker` branch once the builds succeed. - - Windows: queue a new build in `PowerShell Windows Docker Build` on VSTS. -1. Verify the generated docker container images. 1. [Update the homebrew formula](#homebrew) for the macOS package. This task usually will be taken care of by the community, so we can wait for one day or two and see if the homebrew formula has already been updated, @@ -104,7 +99,7 @@ this package will contain actual PowerShell bits (i.e. it is not a meta-package). These bits are installed to `/opt/microsoft/powershell/6.0.0-alpha.8/`, where the version will change with each update -(and is the pre-release version). +(and is the prerelease version). On macOS, the prefix is `/usr/local`, instead of `/opt/microsoft` because it is derived from BSD. @@ -173,7 +168,7 @@ Start-PSPackage -Type zip -ReleaseTag v6.0.0-beta.1 -WindowsRuntime 'win7-x64' ## NuGet Packages -The NuGet packages for hosting PowerShell for Windows and non-Windows are being built in our release build pipeline. +The NuGet packages for hosting PowerShell for Windows and non-Windows are being built-in our release build pipeline. The assemblies from the individual Windows and Linux builds are consumed and packed into NuGet packages. These are then released to [powershell-core feed][ps-core-feed]. @@ -190,7 +185,7 @@ we create an [annotated tag][tag] that names the release. An annotated tag has a message (like a commit), and is *not* the same as a lightweight tag. Create one with `git tag -a v6.0.0-alpha.7 -m `, -and use the release change logs as the message. +and use the release changelogs as the message. Our convention is to prepend the `v` to the semantic version. The summary (first line) of the annotated tag message should be the full release title, e.g. 'v6.0.0-alpha.7 release of PowerShellCore'. diff --git a/tools/performance/README.md b/tools/performance/README.md index c598fca5f28..e0c79659de2 100644 --- a/tools/performance/README.md +++ b/tools/performance/README.md @@ -3,7 +3,7 @@ This directory contains useful scripts and related files for analyzing PowerShell performance. -If you use the [Windows Performance Toolkit](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk), you can use the following to collect data and analyze a trace. +If you use the [Windows Performance Toolkit](https://learn.microsoft.com/windows-hardware/test/wpt/), you can use the following to collect data and analyze a trace. ```PowerShell $PowerShellGitRepo = "D:\PowerShell" From c95557096ac38a11685cdd66b5c58c5113125436 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:56:33 -0800 Subject: [PATCH 0192/1168] Bump xunit from 2.6.4 to 2.6.5 (#21008) --- 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 15c9aec0a0a..f684c66eaf2 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -23,7 +23,7 @@ - + From 39faeb4fb5ba5d3dfd140ab7dd1d2e4f24ee4d92 Mon Sep 17 00:00:00 2001 From: Steven Bucher Date: Mon, 8 Jan 2024 15:59:41 -0800 Subject: [PATCH 0193/1168] Include information about upgrading in README (#20993) --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 290852aeeab..90703c165b4 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,12 @@ You can also download the PowerShell binary archives for Windows, macOS, and Lin To install a specific version, visit [releases](https://github.com/PowerShell/PowerShell/releases). +## Upgrading PowerShell + +For best results when upgrading, you should use the same install method you used when you first +installed PowerShell. The update method will be different for each platform and install method. For +more information, see [Installing PowerShell](https://learn.microsoft.com/powershell/scripting/install/installing-powershell). + ## Community Dashboard [Dashboard](https://aka.ms/PSPublicDashboard) with visualizations for community contributions and project status using PowerShell, Azure, and PowerBI. From 40dbbff35c3ae7091960ac4e12b20bbe42eee9e9 Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Mon, 8 Jan 2024 16:00:07 -0800 Subject: [PATCH 0194/1168] Update the cgmanifest (#20955) --- tools/cgmanifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index 25a318c7580..4993b8afd7f 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -346,7 +346,7 @@ "Type": "nuget", "Nuget": { "Name": "StyleCop.Analyzers.Unstable", - "Version": "1.2.0.507" + "Version": "1.2.0.556" } }, "DevelopmentDependency": true From ac559185d06e4c67961ccf7a1581d452636ef134 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 9 Jan 2024 11:21:31 -0800 Subject: [PATCH 0195/1168] Add `Aliases` to the properties shown up when formatting the help content of the parameter returned by `Get-Help` (#20994) --- .../DefaultFormatters/Help_format_ps1xml.cs | 5 ++++- test/powershell/engine/Help/HelpSystem.Tests.ps1 | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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 d18de013397..05f57286026 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Help_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Help_format_ps1xml.cs @@ -350,7 +350,7 @@ internal static IEnumerable GetFormatData() .AddNewline() .AddText(HelpDisplayStrings.ParameterPosition) .AddScriptBlockExpressionBinding(@" ", selectedByScript: @"($_.position -eq $()) -or ($_.position -eq '')", customControl: control7) - .AddScriptBlockExpressionBinding(@"$_.position", selectedByScript: "$_.position -ne $()") + .AddScriptBlockExpressionBinding(@"$_.position", selectedByScript: "$_.position -ne $()") .AddNewline() .AddText(HelpDisplayStrings.ParameterDefaultValue) .AddPropertyExpressionBinding(@"defaultValue") @@ -358,6 +358,9 @@ internal static IEnumerable GetFormatData() .AddText(HelpDisplayStrings.AcceptsPipelineInput) .AddPropertyExpressionBinding(@"pipelineInput") .AddNewline() + .AddText(HelpDisplayStrings.ParameterAliases) + .AddPropertyExpressionBinding(@"aliases") + .AddNewline() .AddText(HelpDisplayStrings.AcceptsWildCardCharacters) .AddPropertyExpressionBinding(@"globbing", customControl: MamlTrueFalseShortControl) .AddNewline() diff --git a/test/powershell/engine/Help/HelpSystem.Tests.ps1 b/test/powershell/engine/Help/HelpSystem.Tests.ps1 index 53ce9ad7494..380aca1e2b5 100644 --- a/test/powershell/engine/Help/HelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/HelpSystem.Tests.ps1 @@ -112,6 +112,15 @@ Describe "Validate that get-help works for CurrentUserScope" -Tags @('CI') { $help.Description | Out-String | Should -Match $cmdletName $help.Examples | Out-String | Should -Match $cmdletName } + + It "Validate 'Aliases' is present in help content formatting" { + ## The parameter help content should be formatted with the following section: + ## Accept pipeline input? xxxx + ## Aliases NoOverwrite + ## Accept wildcard characters? xxxx + $output = Get-Help Import-Module -Parameter NoClobber | Out-String + $output | Should -Match "Accept pipeline input\?.*\n\s+Aliases\s+NoOverwrite.*\n\s+Accept wildcard characters\?.*" + } } } From 9cc5826026d706dc27b66c8896b31c42f94d9b35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:48:06 -0800 Subject: [PATCH 0196/1168] Bump JsonSchema.Net from 5.4.2 to 5.5.0 (#21027) --- .../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 c2c4b46ff92..e5b45494a00 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -35,7 +35,7 @@ - + From 68204ae14f5da2accb0a9680d4077121f9c3a43c Mon Sep 17 00:00:00 2001 From: CarloToso <105941898+CarloToso@users.noreply.github.com> Date: Thu, 11 Jan 2024 07:49:31 +0100 Subject: [PATCH 0197/1168] Fix regression -Tail 0 -Wait (#20734) --- .../commands/management/GetContentCommand.cs | 4 ++-- .../Get-Content.Tests.ps1 | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs index 4e83eda905f..a9d8772a5fc 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs @@ -87,7 +87,7 @@ protected override void ProcessRecord() return; } - if (TotalCount == 0 || Tail == 0) + if (TotalCount == 0) { // Don't read anything return; @@ -118,7 +118,7 @@ protected override void ProcessRecord() // as reading forwards. So we read forwards in this case. // If Tail is positive, we seek the right position. Or, if the seek failed // because of an unsupported encoding, we scan forward to get the tail content. - if (Tail > 0) + if (Tail >= 0) { bool seekSuccess = false; 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 5e8e258b85a..02b6f79fbc4 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Content.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Content.Tests.ps1 @@ -283,6 +283,16 @@ Describe "Get-Content" -Tags "CI" { Get-Content -Path $testPath -Tail 0 | Should -BeNullOrEmpty } + It "Should wait for content when using -Tail 0 and -Wait" { + $testValues = @(1,2,3) + $Job = Start-Job -ScriptBlock {Get-Content -Path $using:testPath -Tail 0 -Wait} + Start-Sleep -Seconds 3 + Add-Content -Value $testValues -Path $testPath + Start-Sleep -Seconds 3 + Compare-Object -ReferenceObject $testValues -DifferenceObject ($Job | Receive-Job) | Should -BeNullOrEmpty + $Job | Remove-Job -Force + } + It "Should throw TailAndHeadCannotCoexist when both -Tail and -TotalCount are used" { { Get-Content -Path $testPath -Tail 1 -TotalCount 1 -ErrorAction Stop From a8e1924c3d5c4cd62607b511a3960839346f5f9b Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 11 Jan 2024 15:13:18 -0800 Subject: [PATCH 0198/1168] Update README.md and metadata.json for v7.2.18 and v7.4.1 releases (#21044) --- README.md | 56 ++++++++++++++++++++++----------------------- tools/metadata.json | 6 ++--- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 90703c165b4..7b5fbb0ba6c 100644 --- a/README.md +++ b/README.md @@ -64,33 +64,33 @@ You can also download the PowerShell binary archives for Windows, macOS, and Lin | Windows (ARM) | [64-bit][rl-winarm64] (preview) | [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-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x86.msi -[lts-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x64.msi -[lts-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb -[lts-rh]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-1.rh.x86_64.rpm -[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-osx-x64.pkg -[lts-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-osx-arm64.pkg - -[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x64.msi -[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x86.msi -[rl-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb -[rl-ubuntu22]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb -[rl-ubuntu20]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb -[rl-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb -[rl-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb -[rl-debian11]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell_7.4.0-1.deb_amd64.deb -[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-1.rh.x86_64.rpm -[rl-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-1.rh.x86_64.rpm -[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-osx-x64.pkg -[rl-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-osx-arm64.pkg -[rl-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-arm64.zip -[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x86.zip -[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/PowerShell-7.4.0-win-x64.zip -[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-osx-x64.tar.gz -[rl-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-osx-arm64.tar.gz -[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-linux-x64.tar.gz -[rl-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-linux-arm32.tar.gz -[rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-linux-arm64.tar.gz +[lts-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/PowerShell-7.4.1-win-x86.msi +[lts-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/PowerShell-7.4.1-win-x64.msi +[lts-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell_7.4.1-1.deb_amd64.deb +[lts-rh]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-1.rh.x86_64.rpm +[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-osx-x64.pkg +[lts-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-osx-arm64.pkg + +[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/PowerShell-7.4.1-win-x64.msi +[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/PowerShell-7.4.1-win-x86.msi +[rl-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell_7.4.1-1.deb_amd64.deb +[rl-ubuntu22]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell_7.4.1-1.deb_amd64.deb +[rl-ubuntu20]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell_7.4.1-1.deb_amd64.deb +[rl-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell_7.4.1-1.deb_amd64.deb +[rl-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell_7.4.1-1.deb_amd64.deb +[rl-debian11]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell_7.4.1-1.deb_amd64.deb +[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-1.rh.x86_64.rpm +[rl-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-1.rh.x86_64.rpm +[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-osx-x64.pkg +[rl-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-osx-arm64.pkg +[rl-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/PowerShell-7.4.1-win-arm64.zip +[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/PowerShell-7.4.1-win-x86.zip +[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/PowerShell-7.4.1-win-x64.zip +[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-osx-x64.tar.gz +[rl-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-osx-arm64.tar.gz +[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-linux-x64.tar.gz +[rl-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-linux-arm32.tar.gz +[rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-linux-arm64.tar.gz [rl-snap]: https://snapcraft.io/powershell [pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/PowerShell-7.4.0-rc.1-win-x64.msi @@ -113,7 +113,7 @@ You can also download the PowerShell binary archives for Windows, macOS, and Lin [in-ubuntu16]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-1604 [in-ubuntu18]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-1804 [in-ubuntu20]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-2004 -[in-ubuntu22]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-linux?view=powershell-7.3#ubuntu +[in-ubuntu22]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-linux#ubuntu [in-deb10]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#debian-10 [in-centos]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#centos-7 [in-rhel7]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#red-hat-enterprise-linux-rhel-7 diff --git a/tools/metadata.json b/tools/metadata.json index b548546b249..58c3c5280e4 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,9 +1,9 @@ { - "StableReleaseTag": "v7.4.0", + "StableReleaseTag": "v7.4.1", "PreviewReleaseTag": "v7.4.0-rc.1", "ServicingReleaseTag": "v7.0.13", - "ReleaseTag": "v7.4.0", - "LTSReleaseTag" : ["v7.2.17", "v7.4.0"], + "ReleaseTag": "v7.4.1", + "LTSReleaseTag" : ["v7.2.18", "v7.4.1"], "NextReleaseTag": "v7.5.0-preview.1", "LTSRelease": { "Latest": false, "Package": false }, "StableRelease": { "Latest": false, "Package": false } From e453c006d39a2fa57a903df2d0ea33ddd0cb43dd Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 11 Jan 2024 15:37:37 -0800 Subject: [PATCH 0199/1168] Update changelog for v7.2 and v7.3 (#21052) --- CHANGELOG/7.2.md | 139 ++++++++++++++++++++++++++++++++++++++++++++++ CHANGELOG/7.3.md | 141 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 280 insertions(+) diff --git a/CHANGELOG/7.2.md b/CHANGELOG/7.2.md index ca7e08a2613..f5e45fefb08 100644 --- a/CHANGELOG/7.2.md +++ b/CHANGELOG/7.2.md @@ -1,5 +1,144 @@ # 7.2 Changelog +## [7.2.18] - 2024-01-11 + +### Build and Packaging Improvements + +
+ + + +

Bump .NET to 6.0.418

+ +
+ +
    +
  • Update ThirdPartyNotices.txt for v7.2.18 (Internal 29173)
  • +
  • Update cgmanifest.json for v7.2.18 release (Internal 29161)
  • +
  • Update .NET SDK to 6.0.418 (Internal 29141)
  • +
  • Back port 3 build changes to apiscan.yml (#21036)
  • +
  • Set the ollForwardOnNoCandidateFx in runtimeconfig.json to roll forward only on minor and patch versions (#20689)
  • +
  • Remove the ref folder before running compliance (#20373)
  • +
  • Fix the tab completion tests (#20867)
  • +
+ +
+ +[7.2.18]: https://github.com/PowerShell/PowerShell/compare/v7.2.17...v7.2.18 + +## [7.2.17] - 2023-11-16 + +### General Cmdlet Updates and Fixes + +- Redact Auth header content from ErrorRecord (Internal 28411) + +### Build and Packaging Improvements + +
+ + + +

Bump to .NET to version 6.0.417

+ +
+ +
    +
  • Bump to .NET 6.0.417 (Internal 28486)
  • +
  • Copy azure blob with PowerShell global tool to private blob and move to CDN during release (Internal 28450)
  • +
+ +
+ +[7.2.17]: https://github.com/PowerShell/PowerShell/compare/v7.2.16...v7.2.17 + +## [7.2.16] - 2023-10-26 + +### Build and Packaging Improvements + +
+ + + +

Update .NET 6 to version 6.0.416

+ +
+ +
    +
  • Fix release pipeline yaml
  • +
  • Fix issues with merging backports in packaging (Internal 28158)
  • +
  • Update .NET 6 and TPN (Internal 28149)
  • +
  • Add runtime and packaging type info for mariner2 arm64 (#19450) (#20564)
  • +
  • Add mariner arm64 to PMC release (#20176) (#20567)
  • +
  • Remove HostArchitecture dynamic parameter for osxpkg (#19917) (#20565)
  • +
  • Use fxdependent-win-desktop runtime for compliance runs (#20326) (#20568)
  • +
  • Add SBOM for release pipeline (#20519) (#20570)
  • +
  • Increase timeout when publishing packages to pacakages.microsoft.com (#20470) (#20569)
  • +
  • Add mariner arm64 package build to release build (#19946) (#20566)
  • +
+ +
+ +[7.2.16]: https://github.com/PowerShell/PowerShell/compare/v7.2.15...v7.2.16 + +## [7.2.15] - 2023-10-10 + +### Security Fixes + +- Block getting help from network locations in restricted remoting sessions (Internal 27699) + +### Build and Packaging Improvements + +
+ + + +

Build infrastructure maintenance

+ +
+ +
    +
  • Release build: Change the names of the PATs (#20315)
  • +
  • Switch to GitHub Action for linting markdown (#20309)
  • +
  • Put the calls to Set-AzDoProjectInfo and Set-AzDoAuthToken` in the right order (#20312)
  • +
+ +
+ +[7.2.15]: https://github.com/PowerShell/PowerShell/compare/v7.2.14...v7.2.15 + +## [7.2.14] - 2023-09-18 + +### Build and Packaging Improvements + +
+ + + +

Bump .NET SDK version to 6.0.414

+ +
+ +
    +
  • Update to use .NET SDK 6.0.414 (Internal 27575)
  • +
  • Enable vPack provenance data (#20242)
  • +
  • Start using new packages.microsoft.com CLI (#20241)
  • +
  • Remove spelling CI in favor of GitHub Action (#20239)
  • +
  • Make PR creation tool use --web because it is more reliable (#20238)
  • +
  • Update variable used to bypass the blocking check for multiple NuGet feeds (#20237)
  • +
  • Don't publish notice on failure because it prevents retry (#20236)
  • +
  • Publish rpm package for rhel9 (#20234)
  • +
  • Add ProductCode in registry for MSI install (#20233)
  • +
+ +
+ +### Documentation and Help Content + +- Update man page to match current help for pwsh (#20240) +- Update the link for getting started in `README.md` (#20235) + +[7.2.14]: https://github.com/PowerShell/PowerShell/compare/v7.2.13...v7.2.14 + ## [7.2.13] - 2023-07-13 ### Tests diff --git a/CHANGELOG/7.3.md b/CHANGELOG/7.3.md index e0e511feea8..fbc087d643d 100644 --- a/CHANGELOG/7.3.md +++ b/CHANGELOG/7.3.md @@ -1,5 +1,146 @@ # 7.3 Changelog +## [7.3.11] - 2024-01-11 + +### Build and Packaging Improvements + +
+ + + +

Bump .NET to 7.0.405

+ +
+ +
    +
  • Update cgmanifest.json for v7.3.11 release (Internal 29160)
  • +
  • Update .NET SDK to 7.0.405 (Internal 29140)
  • +
  • Back port 3 build changes to apiscan.yml (#21035)
  • +
  • Set the ollForwardOnNoCandidateFx in runtimeconfig.json to roll forward only on minor and patch versions (#20689)
  • +
  • Remove the ref folder before running compliance (#20373)
  • +
  • Fix the tab completion tests (#20867)
  • +
+ +
+ +[7.3.11]: https://github.com/PowerShell/PowerShell/compare/v7.3.10...v7.3.11 + +## [7.3.10] - 2023-11-16 + +### General Cmdlet Updates and Fixes + +- Redact Auth header content from ErrorRecord (Internal 28410) + +### Build and Packaging Improvements + +
+ + + +

Update .NET to 7.0.404

+ +
+ +
    +
  • Add internal .NET SDK URL parameter to release pipeline (Internal 28505)
  • +
  • Fix release build by making the internal SDK parameter optional (#20658) (Internal 28440)
  • +
  • Make internal .NET SDK URL as a parameter for release builld (#20655) (Internal 28428)
  • +
  • Update the Notices file and cgmanifest (Internal 28500)
  • +
  • Update .NET to 7.0.404 (Internal 28485)
  • +
  • Copy azure blob with PowerShell global tool to private blob and move to CDN during release (Internal 28448)
  • +
+ +
+ +[7.3.10]: https://github.com/PowerShell/PowerShell/compare/v7.3.9...v7.3.10 + +## [7.3.9] - 2023-10-26 + +### Build and Packaging Improvements + +
+ + + +

Bump .NET 7 to version 7.0.403

+ +
+ +
    +
  • Use correct agent pool for downloading from Azure blob
  • +
  • Remove a timeout value from ADO pipeline stage to resolve a syntax issue
  • +
  • Update .NET 7 and manifests (Internal 28148)
  • +
  • Add SBOM for release pipeline (#20519) (#20573)
  • +
  • Increase timeout when publishing packages to pacakages.microsoft.com (#20470) (#20572)
  • +
  • Use fxdependent-win-desktop runtime for compliance runs (#20326) (#20571)
  • +
+ +
+ +[7.3.9]: https://github.com/PowerShell/PowerShell/compare/v7.3.8...v7.3.9 + +## [7.3.8] - 2023-10-10 + +### Security Fixes + +- Block getting help from network locations in restricted remoting sessions (Internal 27698) + +### Build and Packaging Improvements + +
+ + + +

Build infrastructure maintenance

+ +
+ +
    +
  • Release build: Change the names of the PATs (#20316)
  • +
  • Add mapping for mariner arm64 stable (#20310)
  • +
  • Switch to GitHub Action for linting markdown (#20308)
  • +
  • Put the calls to Set-AzDoProjectInfo and Set-AzDoAuthToken` in the right order (#20311)
  • +
+ +
+ +[7.3.8]: https://github.com/PowerShell/PowerShell/compare/v7.3.7...v7.3.8 + +## [7.3.7] - 2023-09-18 + +### Build and Packaging Improvements + +
+ + + +

Bump .NET SDK version to 7.0.401

+ +
+ +
    +
  • Update 'ThirdPartyNotices.txt' (Internal 27602)
  • +
  • Update to use .NET SDK 7.0.401 (Internal 27591)
  • +
  • Remove HostArchitecture dynamic parameter for osxpkg (#19917)
  • +
  • Remove spelling CI in favor of GitHub Action (#20248)
  • +
  • Enable vPack provenance data (#20253)
  • +
  • Start using new packages.microsoft.com cli (#20252)
  • +
  • Add mariner arm64 to PMC release (#20251)
  • +
  • Add mariner arm64 package build to release build (#20250)
  • +
  • Make PR creation tool use --web because it is more reliable (#20247)
  • +
  • Update variable used to bypass the blocking check for multiple NuGet feeds (#20246)
  • +
  • Publish rpm package for rhel9 (#20245)
  • +
  • Add runtime and packaging type info for mariner2 arm64 (#20244)
  • +
+ +
+ +### Documentation and Help Content + +- Update man page to match current help for pwsh (#20249) + +[7.3.7]: https://github.com/PowerShell/PowerShell/compare/v7.3.6...v7.3.7 + ## [7.3.6] - 2023-07-13 ### Build and Packaging Improvements From 023b1f565c67212f3e5129aefb55d465a5b86393 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 12:39:24 -0800 Subject: [PATCH 0200/1168] Bump xunit from 2.6.5 to 2.6.6 (#21071) --- 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 f684c66eaf2..1fe686756f9 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -23,7 +23,7 @@ - + From 1682d6162686d35795fa7a9f428d2c8150bb466d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 13:21:43 -0800 Subject: [PATCH 0201/1168] Bump StyleCop.Analyzers from 1.2.0-beta.507 to 1.2.0-beta.556 (#20953) --- Analyzers.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Analyzers.props b/Analyzers.props index 2608f972630..6f906496c73 100644 --- a/Analyzers.props +++ b/Analyzers.props @@ -1,6 +1,6 @@ - + From ad2076748b671fb3fa1547058122a636affbc727 Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Tue, 16 Jan 2024 13:23:07 -0800 Subject: [PATCH 0202/1168] Update to the latest NOTICES file (#20905) --- ThirdPartyNotices.txt | 591 ++++++++++++++++++++++-------------------- 1 file changed, 310 insertions(+), 281 deletions(-) diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 14aba61a13f..d82e4dde2a4 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -135,7 +135,7 @@ limitations under the License. --------------------------------------------------------- -Markdig.Signed 0.33.0 - BSD-2-Clause +Markdig.Signed 0.34.0 - BSD-2-Clause @@ -238,7 +238,7 @@ SOFTWARE. --------------------------------------------------------- -JsonSchema.Net 5.2.6 - MIT +JsonSchema.Net 5.4.2 - MIT @@ -256,7 +256,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.ApplicationInsights 2.21.0 - MIT +Microsoft.ApplicationInsights 2.22.0 - MIT (c) Microsoft Corporation @@ -344,7 +344,7 @@ SOFTWARE. --------------------------------------------------------- -Microsoft.CodeAnalysis.Common 4.7.0 - MIT +Microsoft.CodeAnalysis.Common 4.8.0 - MIT (c) Microsoft Corporation @@ -364,7 +364,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --------------------------------------------------------- -Microsoft.CodeAnalysis.CSharp 4.7.0 - MIT +Microsoft.CodeAnalysis.CSharp 4.8.0 - MIT (c) Microsoft Corporation @@ -479,9 +479,10 @@ SOFTWARE. --------------------------------------------------------- -Microsoft.Win32.Registry.AccessControl 7.0.0 - MIT +Microsoft.Win32.Registry.AccessControl 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -491,11 +492,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -510,12 +513,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -529,7 +535,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -560,9 +565,10 @@ SOFTWARE. --------------------------------------------------------- -Microsoft.Win32.SystemEvents 7.0.0 - MIT +Microsoft.Win32.SystemEvents 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -572,11 +578,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -591,12 +599,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -610,7 +621,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -641,82 +651,20 @@ SOFTWARE. --------------------------------------------------------- -Microsoft.Windows.Compatibility 7.0.5 - MIT +Microsoft.Windows.Compatibility 8.0.0 - MIT (c) Microsoft Corporation -Copyright (c) Andrew Arnott -Copyright 2019 LLVM Project -Copyright 2018 Daniel Lemire -Copyright (c) .NET Foundation -Copyright (c) 2011, Google Inc. -Copyright (c) 2020 Dan Shechter -(c) 1997-2005 Sean Eron Anderson -Copyright (c) 1998 Microsoft. To -Copyright (c) 2017 Yoshifumi Kawai -Copyright (c) 2005-2020 Rich Felker -Copyright (c) Microsoft Corporation -Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet -Copyright (c) 1991-2022 Unicode, Inc. -Copyright (c) 2013-2017, Alfred Klomp -Copyright 2012 the V8 project authors -Copyright (c) 1999 Lucent Technologies -Copyright (c) 2008-2016, Wojciech Mula -Copyright (c) 2011-2020 Microsoft Corp -Copyright (c) 2015-2017, Wojciech Mula -Copyright (c) 2021 csFastFloat authors -Copyright (c) 2005-2007, Nick Galbreath -Copyright (c) 2015 The Chromium Authors -Copyright (c) 2018 Alexander Chermyanin -Copyright (c) The Internet Society 1997 -Portions (c) International Organization -Copyright (c) 2004-2006 Intel Corporation -Copyright (c) 2013-2017, Milosz Krajewski -Copyright (c) 2016-2017, Matthieu Darbois -Copyright (c) The Internet Society (2003) -Copyright (c) .NET Foundation Contributors -Copyright (c) 2020 Mara Bos -Copyright (c) .NET Foundation and Contributors -Copyright (c) 2008-2020 Advanced Micro Devices, Inc. -Copyright (c) 2019 Microsoft Corporation, Daan Leijen -Copyright (c) 2011 Novell, Inc (http://www.novell.com) -Copyright (c) 1995-2022 Jean-loup Gailly and Mark Adler -Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) -Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors -Copyright (c) 2014 Ryan Juckett http://www.ryanjuckett.com -Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. -Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers -Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip -Copyright (c) 1980, 1986, 1993 The Regents of the University of California -Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To - -The MIT License (MIT) -Copyright (c) .NET Foundation and Contributors - -All rights reserved. +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 -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: +Copyright (c) -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +Permission is hereby 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: -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 THE -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. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +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 THE 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. --------------------------------------------------------- @@ -756,9 +704,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------- -runtime.linux-arm.runtime.native.System.IO.Ports 7.0.0 - MIT +runtime.linux-arm.runtime.native.System.IO.Ports 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -768,11 +717,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -787,12 +738,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -806,7 +760,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -837,9 +790,10 @@ SOFTWARE. --------------------------------------------------------- -runtime.linux-arm64.runtime.native.System.IO.Ports 7.0.0 - MIT +runtime.linux-arm64.runtime.native.System.IO.Ports 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -849,11 +803,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -868,12 +824,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -887,7 +846,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -918,9 +876,10 @@ SOFTWARE. --------------------------------------------------------- -runtime.linux-x64.runtime.native.System.IO.Ports 7.0.0 - MIT +runtime.linux-x64.runtime.native.System.IO.Ports 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -930,11 +889,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -949,12 +910,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -968,7 +932,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -1052,9 +1015,10 @@ SOFTWARE. --------------------------------------------------------- -runtime.native.System.IO.Ports 7.0.0 - MIT +runtime.native.System.IO.Ports 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -1064,11 +1028,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -1083,12 +1049,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -1102,7 +1071,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -1133,9 +1101,10 @@ SOFTWARE. --------------------------------------------------------- -runtime.osx-arm64.runtime.native.System.IO.Ports 7.0.0 - MIT +runtime.osx-arm64.runtime.native.System.IO.Ports 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -1145,11 +1114,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -1164,12 +1135,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -1183,7 +1157,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -1214,9 +1187,10 @@ SOFTWARE. --------------------------------------------------------- -runtime.osx-x64.runtime.native.System.IO.Ports 7.0.0 - MIT +runtime.osx-x64.runtime.native.System.IO.Ports 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -1226,11 +1200,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -1245,12 +1221,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -1264,7 +1243,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -1295,9 +1273,10 @@ SOFTWARE. --------------------------------------------------------- -System.CodeDom 7.0.0 - MIT +System.CodeDom 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -1307,11 +1286,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -1326,12 +1307,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -1345,7 +1329,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -1457,9 +1440,10 @@ SOFTWARE. --------------------------------------------------------- -System.ComponentModel.Composition 7.0.0 - MIT +System.ComponentModel.Composition 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -1469,11 +1453,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -1488,12 +1474,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -1507,7 +1496,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -1538,9 +1526,10 @@ SOFTWARE. --------------------------------------------------------- -System.ComponentModel.Composition.Registration 7.0.0 - MIT +System.ComponentModel.Composition.Registration 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -1550,11 +1539,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -1569,12 +1560,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -1588,7 +1582,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -1619,9 +1612,10 @@ SOFTWARE. --------------------------------------------------------- -System.Configuration.ConfigurationManager 7.0.0 - MIT +System.Configuration.ConfigurationManager 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -1631,11 +1625,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -1650,12 +1646,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -1669,7 +1668,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -1700,9 +1698,10 @@ SOFTWARE. --------------------------------------------------------- -System.Data.Odbc 7.0.0 - MIT +System.Data.Odbc 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -1712,11 +1711,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -1731,12 +1732,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -1750,7 +1754,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -1781,9 +1784,10 @@ SOFTWARE. --------------------------------------------------------- -System.Data.OleDb 7.0.0 - MIT +System.Data.OleDb 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -1793,11 +1797,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -1812,12 +1818,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -1831,7 +1840,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -1915,9 +1923,10 @@ SOFTWARE. --------------------------------------------------------- -System.Diagnostics.DiagnosticSource 7.0.2 - MIT +System.Diagnostics.DiagnosticSource 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -1927,11 +1936,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -1946,12 +1957,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -1965,7 +1979,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -1996,9 +2009,10 @@ SOFTWARE. --------------------------------------------------------- -System.Diagnostics.EventLog 7.0.0 - MIT +System.Diagnostics.EventLog 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -2008,11 +2022,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -2027,12 +2043,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -2046,7 +2065,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -2077,9 +2095,10 @@ SOFTWARE. --------------------------------------------------------- -System.Diagnostics.PerformanceCounter 7.0.0 - MIT +System.Diagnostics.PerformanceCounter 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -2089,11 +2108,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -2108,12 +2129,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -2127,7 +2151,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -2158,9 +2181,10 @@ SOFTWARE. --------------------------------------------------------- -System.DirectoryServices 7.0.1 - MIT +System.DirectoryServices 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -2170,11 +2194,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -2189,12 +2215,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -2208,7 +2237,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -2239,9 +2267,10 @@ SOFTWARE. --------------------------------------------------------- -System.DirectoryServices.AccountManagement 7.0.1 - MIT +System.DirectoryServices.AccountManagement 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -2251,11 +2280,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -2270,12 +2301,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -2289,7 +2323,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -2320,9 +2353,10 @@ SOFTWARE. --------------------------------------------------------- -System.DirectoryServices.Protocols 7.0.1 - MIT +System.DirectoryServices.Protocols 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -2332,11 +2366,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -2351,12 +2387,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -2370,7 +2409,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -2401,57 +2439,12 @@ SOFTWARE. --------------------------------------------------------- -System.Drawing.Common 7.0.0 - MIT +System.Drawing.Common 8.0.0 - MIT (c) Microsoft Corporation -Copyright (c) Andrew Arnott -Copyright 2019 LLVM Project -Copyright 2018 Daniel Lemire -Copyright (c) .NET Foundation -Copyright (c) 2011, Google Inc. -Copyright (c) 2020 Dan Shechter -(c) 1997-2005 Sean Eron Anderson -Copyright (c) 1998 Microsoft. To -Copyright (c) 2017 Yoshifumi Kawai -Copyright (c) 2005-2020 Rich Felker -Copyright (c) Microsoft Corporation -Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet -Copyright (c) 1991-2022 Unicode, Inc. -Copyright (c) 2013-2017, Alfred Klomp -Copyright 2012 the V8 project authors -Copyright (c) 1999 Lucent Technologies -Copyright (c) 2008-2016, Wojciech Mula -Copyright (c) 2011-2020 Microsoft Corp -Copyright (c) 2015-2017, Wojciech Mula -Copyright (c) 2021 csFastFloat authors -Copyright (c) 2005-2007, Nick Galbreath -Copyright (c) 2015 The Chromium Authors -Copyright (c) 2018 Alexander Chermyanin -Copyright (c) The Internet Society 1997 -Portions (c) International Organization -Copyright (c) 2004-2006 Intel Corporation -Copyright (c) 2013-2017, Milosz Krajewski -Copyright (c) 2016-2017, Matthieu Darbois -Copyright (c) The Internet Society (2003) -Copyright (c) .NET Foundation Contributors -Copyright (c) 2020 Mara Bos +Copyright (c) Sven Groot (Ookii.org) 2009 Copyright (c) .NET Foundation and Contributors -Copyright (c) 2008-2020 Advanced Micro Devices, Inc. -Copyright (c) 2019 Microsoft Corporation, Daan Leijen -Copyright (c) 2011 Novell, Inc (http://www.novell.com) -Copyright (c) 1995-2022 Jean-loup Gailly and Mark Adler -Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) -Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors -Copyright (c) 2014 Ryan Juckett http://www.ryanjuckett.com -Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. -Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers -Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip -Copyright (c) 1980, 1986, 1993 The Regents of the University of California -Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -2477,14 +2470,14 @@ 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. - --------------------------------------------------------- --------------------------------------------------------- -System.Formats.Asn1 7.0.0 - MIT +System.Formats.Asn1 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -2494,11 +2487,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -2513,12 +2508,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -2532,7 +2530,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -2563,9 +2560,10 @@ SOFTWARE. --------------------------------------------------------- -System.IO.Packaging 7.0.0 - MIT +System.IO.Packaging 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -2575,11 +2573,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -2594,12 +2594,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -2613,7 +2616,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -2644,9 +2646,10 @@ SOFTWARE. --------------------------------------------------------- -System.IO.Ports 7.0.0 - MIT +System.IO.Ports 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -2656,11 +2659,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -2675,12 +2680,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -2694,7 +2702,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -2725,9 +2732,10 @@ SOFTWARE. --------------------------------------------------------- -System.Management 7.0.2 - MIT +System.Management 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -2737,11 +2745,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -2756,12 +2766,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -2775,7 +2788,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -2806,9 +2818,10 @@ SOFTWARE. --------------------------------------------------------- -System.Net.Http.WinHttpHandler 7.0.0 - MIT +System.Net.Http.WinHttpHandler 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -2818,11 +2831,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -2837,12 +2852,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -2856,7 +2874,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -2972,9 +2989,10 @@ SOFTWARE. --------------------------------------------------------- -System.Reflection.Context 7.0.0 - MIT +System.Reflection.Context 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -2984,11 +3002,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -3003,12 +3023,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -3022,7 +3045,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -3187,9 +3209,10 @@ SOFTWARE. --------------------------------------------------------- -System.Runtime.Caching 7.0.0 - MIT +System.Runtime.Caching 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -3199,11 +3222,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -3218,12 +3243,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -3237,7 +3265,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -3408,9 +3435,10 @@ SOFTWARE. --------------------------------------------------------- -System.Security.Cryptography.Pkcs 7.0.3 - MIT +System.Security.Cryptography.Pkcs 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -3420,11 +3448,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -3439,12 +3469,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -3458,7 +3491,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -3489,9 +3521,10 @@ SOFTWARE. --------------------------------------------------------- -System.Security.Cryptography.ProtectedData 7.0.1 - MIT +System.Security.Cryptography.ProtectedData 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -3501,11 +3534,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -3520,12 +3555,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -3539,7 +3577,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -3570,9 +3607,10 @@ SOFTWARE. --------------------------------------------------------- -System.Security.Cryptography.Xml 7.0.1 - MIT +System.Security.Cryptography.Xml 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -3582,11 +3620,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -3601,12 +3641,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -3620,7 +3663,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -3651,9 +3693,10 @@ SOFTWARE. --------------------------------------------------------- -System.Security.Permissions 7.0.0 - MIT +System.Security.Permissions 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -3663,11 +3706,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -3682,12 +3727,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -3701,7 +3749,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -3981,9 +4028,10 @@ SOFTWARE. --------------------------------------------------------- -System.ServiceModel.Syndication 7.0.0 - MIT +System.ServiceModel.Syndication 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -3993,11 +4041,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -4012,12 +4062,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -4031,7 +4084,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -4062,9 +4114,10 @@ SOFTWARE. --------------------------------------------------------- -System.ServiceProcess.ServiceController 7.0.1 - MIT +System.ServiceProcess.ServiceController 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -4074,11 +4127,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -4093,12 +4148,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -4112,7 +4170,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -4143,9 +4200,10 @@ SOFTWARE. --------------------------------------------------------- -System.Speech 7.0.0 - MIT +System.Speech 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -4155,11 +4213,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -4174,12 +4234,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -4193,7 +4256,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -4224,57 +4286,9 @@ SOFTWARE. --------------------------------------------------------- -System.Text.Encoding.CodePages 7.0.0 - MIT +System.Text.Encoding.CodePages 8.0.0 - MIT -(c) Microsoft Corporation -Copyright (c) Andrew Arnott -Copyright 2019 LLVM Project -Copyright 2018 Daniel Lemire -Copyright (c) .NET Foundation -Copyright (c) 2011, Google Inc. -Copyright (c) 2020 Dan Shechter -(c) 1997-2005 Sean Eron Anderson -Copyright (c) 1998 Microsoft. To -Copyright (c) 2017 Yoshifumi Kawai -Copyright (c) 2005-2020 Rich Felker -Copyright (c) Microsoft Corporation -Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet -Copyright (c) 1991-2022 Unicode, Inc. -Copyright (c) 2013-2017, Alfred Klomp -Copyright 2012 the V8 project authors -Copyright (c) 1999 Lucent Technologies -Copyright (c) 2008-2016, Wojciech Mula -Copyright (c) 2011-2020 Microsoft Corp -Copyright (c) 2015-2017, Wojciech Mula -Copyright (c) 2021 csFastFloat authors -Copyright (c) 2005-2007, Nick Galbreath -Copyright (c) 2015 The Chromium Authors -Copyright (c) 2018 Alexander Chermyanin -Copyright (c) The Internet Society 1997 -Portions (c) International Organization -Copyright (c) 2004-2006 Intel Corporation -Copyright (c) 2013-2017, Milosz Krajewski -Copyright (c) 2016-2017, Matthieu Darbois -Copyright (c) The Internet Society (2003) -Copyright (c) .NET Foundation Contributors -Copyright (c) 2020 Mara Bos -Copyright (c) .NET Foundation and Contributors -Copyright (c) 2008-2020 Advanced Micro Devices, Inc. -Copyright (c) 2019 Microsoft Corporation, Daan Leijen -Copyright (c) 2011 Novell, Inc (http://www.novell.com) -Copyright (c) 1995-2022 Jean-loup Gailly and Mark Adler -Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) -Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors -Copyright (c) 2014 Ryan Juckett http://www.ryanjuckett.com -Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. -Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers -Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip -Copyright (c) 1980, 1986, 1993 The Regents of the University of California -Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -4305,9 +4319,10 @@ SOFTWARE. --------------------------------------------------------- -System.Text.Encodings.Web 7.0.0 - MIT +System.Text.Encodings.Web 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -4317,11 +4332,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -4336,12 +4353,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -4355,7 +4375,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -4460,9 +4479,10 @@ SOFTWARE. --------------------------------------------------------- -System.Threading.AccessControl 7.0.1 - MIT +System.Threading.AccessControl 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -4472,11 +4492,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -4491,12 +4513,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -4510,7 +4535,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) @@ -4574,9 +4598,10 @@ SOFTWARE. --------------------------------------------------------- -System.Windows.Extensions 7.0.0 - MIT +System.Windows.Extensions 8.0.0 - MIT +Copyright (c) Six Labors (c) Microsoft Corporation Copyright (c) Andrew Arnott Copyright 2019 LLVM Project @@ -4586,11 +4611,13 @@ Copyright (c) 2011, Google Inc. Copyright (c) 2020 Dan Shechter (c) 1997-2005 Sean Eron Anderson Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet Copyright (c) Microsoft Corporation Copyright (c) 2007 James Newton-King -Copyright (c) 2012-2014, Yann Collet Copyright (c) 1991-2022 Unicode, Inc. Copyright (c) 2013-2017, Alfred Klomp Copyright 2012 the V8 project authors @@ -4605,12 +4632,15 @@ Copyright (c) 2018 Alexander Chermyanin Copyright (c) The Internet Society 1997 Portions (c) International Organization Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation Copyright (c) 2013-2017, Milosz Krajewski Copyright (c) 2016-2017, Matthieu Darbois Copyright (c) The Internet Society (2003) Copyright (c) .NET Foundation Contributors Copyright (c) 2020 Mara Bos Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) Copyright (c) 2008-2020 Advanced Micro Devices, Inc. Copyright (c) 2019 Microsoft Corporation, Daan Leijen Copyright (c) 2011 Novell, Inc (http://www.novell.com) @@ -4624,7 +4654,6 @@ Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip Copyright (c) 1980, 1986, 1993 The Regents of the University of California Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass -Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To The MIT License (MIT) From b2ba58442353e740d5e2a45a804da6cfef6c21a3 Mon Sep 17 00:00:00 2001 From: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com> Date: Tue, 16 Jan 2024 13:23:30 -0800 Subject: [PATCH 0203/1168] Update the cgmanifest (#21047) --- tools/cgmanifest.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index 4993b8afd7f..5635b3bc5ac 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -1,5 +1,4 @@ { - "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { @@ -56,7 +55,7 @@ "Type": "nuget", "Nuget": { "Name": "JsonSchema.Net", - "Version": "5.4.2" + "Version": "5.5.0" } }, "DevelopmentDependency": false @@ -831,5 +830,6 @@ }, "DevelopmentDependency": false } - ] + ], + "$schema": "https://json.schemastore.org/component-detection-manifest.json" } From 9da657e3a80e0fb6fdad4fc7da8d5d48ae2a5c2a Mon Sep 17 00:00:00 2001 From: MartinGC94 <42123497+MartinGC94@users.noreply.github.com> Date: Wed, 17 Jan 2024 01:56:13 +0100 Subject: [PATCH 0204/1168] Fix completion crash for the SCCM provider (#20915) --- .../CommandCompletion/CompletionCompleters.cs | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index 78fac731f89..36bbfc8a718 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -4878,10 +4878,22 @@ private static List GetDefaultProviderResults( private static string GetChildNameFromPsObject(dynamic psObject, char separator) { - // The obvious solution would be to use the "PSChildName" property - // but some providers don't have it (like the Variable provider) - // So we use a substring of "PSPath" instead. - string childName = psObject.PSPath ?? string.Empty; + if (((PSObject)psObject).BaseObject is string result) + { + // The "Get-ChildItem" call for this provider returned a string that we assume is the child name. + // This is what the SCCM provider returns. + return result; + } + + string childName = psObject.PSChildName; + if (childName is not null) + { + return childName; + } + + // Some providers (Like the variable provider) don't include a PSChildName property + // so we get the child name from the path instead. + childName = psObject.PSPath ?? string.Empty; int ProviderSeparatorIndex = childName.IndexOf("::", StringComparison.Ordinal); childName = childName.Substring(ProviderSeparatorIndex + 2); int indexOfName = childName.LastIndexOf(separator); @@ -4892,7 +4904,7 @@ private static string GetChildNameFromPsObject(dynamic psObject, char separator) return childName.Substring(indexOfName + 1); } - + /// /// Takes a path and rebuilds it with the specified variable replacements. /// Also escapes special characters as needed. From 8283ac05c3940cb382038808a5d7f615abcfa46d Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 17 Jan 2024 11:53:01 -0800 Subject: [PATCH 0205/1168] Bump .NET SDK to 8.0.101 (#21084) --- DotnetRuntimeMetadata.json | 4 ++-- global.json | 2 +- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json index ae6a9f9a7a6..a2bec0cdc03 100644 --- a/DotnetRuntimeMetadata.json +++ b/DotnetRuntimeMetadata.json @@ -4,10 +4,10 @@ "quality": "daily", "qualityFallback": "preview", "packageVersionPattern": "8.0.0", - "sdkImageVersion": "8.0.100", + "sdkImageVersion": "8.0.101", "nextChannel": "8.0.1xx", "azureFeed": "", - "sdkImageOverride": "8.0.100-rtm.23551.15" + "sdkImageOverride": "" }, "internalfeed": { "url": "" diff --git a/global.json b/global.json index 5ce84955149..d54915e8d4d 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.100" + "version": "8.0.101" } } 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 e5b45494a00..c3e85319fee 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 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index c6e8bf10326..11297118316 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -17,7 +17,7 @@ - + From 31dfb6dd5663af11a80ec2472b5a5255a9344234 Mon Sep 17 00:00:00 2001 From: Steven Bucher Date: Thu, 18 Jan 2024 11:15:29 -0800 Subject: [PATCH 0206/1168] Add `WinGetCommandNotFound` and `CompletionPredictor` modules to track usage (#21040) --- src/System.Management.Automation/utils/Telemetry.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/System.Management.Automation/utils/Telemetry.cs b/src/System.Management.Automation/utils/Telemetry.cs index 020d009b107..ff655bbe60e 100644 --- a/src/System.Management.Automation/utils/Telemetry.cs +++ b/src/System.Management.Automation/utils/Telemetry.cs @@ -382,6 +382,7 @@ static ApplicationInsightsTelemetry() "CompatPowerShellGet", "configci", "ConfigurationManager", + "CompletionPredictor", "DataProtectionManager", "dcbqos", "deduplication", @@ -592,6 +593,7 @@ static ApplicationInsightsTelemetry() "WindowsSearch", "WindowsServerBackup", "WindowsUpdate", + "WinGetCommandNotFound", "wsscmdlets", "wsssetup", "wsus", From 53d1a0d2d9b3bbc0f9f2fafe7c43339c1f457917 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 18 Jan 2024 21:33:23 +0000 Subject: [PATCH 0207/1168] Merged PR 29314: Update ChangeLog for v7.5.0-preview.1 Update ChangeLog for v7.5.0-preview.1 --- CHANGELOG/preview.md | 172 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 171 insertions(+), 1 deletion(-) diff --git a/CHANGELOG/preview.md b/CHANGELOG/preview.md index 28605544ff7..7766f1be6e0 100644 --- a/CHANGELOG/preview.md +++ b/CHANGELOG/preview.md @@ -1,3 +1,173 @@ # Preview Changelog -Information about PowerShell previews will be found in this file +## [7.5.0-preview.1] - 2024-01-18 + +### Breaking Changes + +- Fix `-OlderThan` and `-NewerThan` parameters for `Test-Path` when using `PathType` and date range (#20942) (Thanks @ArmaanMcleod!) + - Previously `-OlderThan` would be ignored if specified together +- Change `New-FileCatalog -CatalogVersion` default to 2 (#20428) (Thanks @ThomasNieto!) + +### General Cmdlet Updates and Fixes + +- Fix completion crash for the SCCM provider (#20815, #20919, #20915) (Thanks @MartinGC94!) +- Fix regression in `Get-Content` when `-Tail 0` and `-Wait` are used together (#20734) (Thanks @CarloToso!) +- Add `Aliases` to the properties shown up when formatting the help content of the parameter returned by `Get-Help` (#20994) +- Add implicit localization fallback to `Import-LocalizedData` (#19896) (Thanks @chrisdent-de!) +- Change `Test-FileCatalog` to use `File.OpenRead` to better handle the case where the file is being used (#20939) (Thanks @dxk3355!) +- Added `-Module` completion for `Save-Help` and `Update-Help` commands (#20678) (Thanks @ArmaanMcleod!) +- Add argument completer to `-Verb` for `Start-Process` (#20415) (Thanks @ArmaanMcleod!) +- Add argument completer to `-Scope` for `*-Variable`, `*-Alias` & `*-PSDrive` commands (#20451) (Thanks @ArmaanMcleod!) +- Add argument completer to `-Verb` for `Get-Verb` and `Get-Command` (#20286) (Thanks @ArmaanMcleod!) +- Fixing incorrect formatting string in `CommandSearcher` trace logging (#20928) (Thanks @powercode!) +- Ensure the filename is not null when logging WDAC ETW events (#20910) (Thanks @jborean93!) +- Fix four regressions introduced by the WDAC logging feature (#20913) +- Leave the input, output, and error handles unset when they are not redirected (#20853) +- Fix `Start-Process -PassThru` to make sure the `ExitCode` property is accessible for the returned `Process` object (#20749) (Thanks @CodeCyclone!) +- Fix `Group-Object` output using interpolated strings (#20745) (Thanks @mawosoft!) +- Fix rendering of `DisplayRoot` for network `PSDrive` (#20793) +- Fix `Invoke-WebRequest` to report correct size when `-Resume` is specified (#20207) (Thanks @LNKLEO!) +- Add `PSAdapter` and `ConsoleGuiTools` to module load telemetry whitelist (#20641) +- Fix Web Cmdlets to allow `WinForm` apps to work correctly (#20606) +- Block getting help from network locations in restricted remoting sessions (#20593) +- Fix `Group-Object` to use current culture for its output (#20608) +- Add argument completer to `-Version` for `Set-StrictMode` (#20554) (Thanks @ArmaanMcleod!) +- Fix `Copy-Item` progress to only show completed when all files are copied (#20517) +- Fix UNC path completion regression (#20419) (Thanks @MartinGC94!) +- Add telemetry to check for specific tags when importing a module (#20371) +- Report error if invalid `-ExecutionPolicy` is passed to `pwsh` (#20460) +- Add `HelpUri` to `Remove-Service` (#20476) +- Fix `unixmode` to handle `setuid` and `sticky` when file is not an executable (#20366) +- Fix `Test-Connection` due to .NET 8 changes (#20369) +- Fix implicit remoting proxy cmdlets to act on common parameters (#20367) +- Set experimental features to stable for 7.4 release (#20285) +- Revert changes to continue using `BinaryFormatter` for `Out-GridView` (#20300) +- Fix `Get-Service` non-terminating error message to include category (#20276) +- Prevent `Export-CSV` from flushing with every input (#20282) (Thanks @Chris--A!) +- Fix a regression in DSC (#20268) +- Include the module version in error messages when module is not found (#20144) (Thanks @ArmaanMcleod!) +- Add `-Empty` and `-InputObject` parameters to `New-Guid` (#20014) (Thanks @CarloToso!) +- Remove the comment trigger from feedback provider (#20136) +- Prevent fallback to file completion when tab completing type names (#20084) (Thanks @MartinGC94!) +- Add the alias `r` to the parameter `-Recurse` for the `Get-ChildItem` command (#20100) (Thanks @kilasuit!) + +### Code Cleanup + +
+ + + +

We thank the following contributors!

+

@eltociear, @ImportTaste, @ThomasNieto, @0o001

+ +
+ +
    +
  • Fix typos in the code base (#20147, #20492, #20632, #21015, #20838) (Thanks @eltociear!)
  • +
  • Add the missing alias LP to -LiteralPath for some cmdlets (#20820) (Thanks @ImportTaste!)
  • +
  • Remove parenthesis for empty attribute parameters (#20087) (Thanks @ThomasNieto!)
  • +
  • Add space around keyword according to the CodeFactor rule (#20090) (Thanks @ThomasNieto!)
  • +
  • Remove blank lines as instructed by CodeFactor rules (#20086) (Thanks @ThomasNieto!)
  • +
  • Remove trailing whitespace (#20085) (Thanks @ThomasNieto!)
  • +
  • Fix typo in error message (#20145) (Thanks @0o001!)
  • +
+ +
+ +### Tools + +- Make sure feedback link in the bot's comment is clickable (#20878) (Thanks @floh96!) +- Fix bot so anyone who comments will remove the "Resolution-No Activity" label (#20788) +- Fix bot configuration to prevent multiple comments about "no activity" (#20758) +- Add bot logic for closing GitHub issues after 6 months of "no activity" (#20525) +- Refactor bot for easier use and updating (#20805) +- Configure bot to add survey comment for closed issues (#20397) + +### Tests + +- Suppress error output from `Set-Location` tests (#20499) +- Fix typo in `FileCatalog.Tests.ps1` (#20329) (Thanks @eltociear!) +- Continue to improve tests for release automation (#20182) +- Skip the test on x86 as `InstallDate` is not visible on `Wow64` (#20165) +- Harden some problematic release tests (#20155) + +### Build and Packaging Improvements + +
+ + + +

We thank the following contributors!

+

@alerickson, @Zhoneym, @0o001

+ +
+ +
    +
  • Bump .NET SDK to 8.0.101 (#21084)
  • +
  • Update the cgmanifest (#20083, #20436, #20523, #20560, #20627, #20764, #20906, #20933, #20955, #21047)
  • +
  • Update to the latest NOTICES file (#20074, #20161, #20385, #20453, #20576, #20590, #20880, #20905)
  • +
  • Bump StyleCop.Analyzers from 1.2.0-beta.507 to 1.2.0-beta.556 (#20953)
  • +
  • Bump xUnit to 2.6.6 (#21071)
  • +
  • Bump JsonSchema.Net to 5.5.0 (#21027)
  • +
  • Fix failures in GitHub action markdown-link-check (#20996)
  • +
  • Bump xunit.runner.visualstudio to 2.5.6 (#20966)
  • +
  • Bump github/codeql-action from 2 to 3 (#20927)
  • +
  • Bump Markdig.Signed to 0.34.0 (#20926)
  • +
  • Bump Microsoft.ApplicationInsights from 2.21.0 to 2.22.0 (#20888)
  • +
  • Bump Microsoft.NET.Test.Sdk to 17.8.0 (#20660)
  • +
  • Update apiscan.yml to have access to the AzDevOpsArtifacts variable group (#20671)
  • +
  • Set the ollForwardOnNoCandidateFx in runtimeconfig.json to roll forward only on minor and patch versions (#20689)
  • +
  • Sign the global tool shim executable (#20794)
  • +
  • Bump actions/github-script from 6 to 7 (#20682)
  • +
  • Remove RHEL7 publishing to packages.microsoft.com as it's no longer supported (#20849)
  • +
  • Bump Microsoft.CodeAnalysis.CSharp to 4.8.0 (#20751)
  • +
  • Add internal nuget feed to compliance build (#20669)
  • +
  • Copy azure blob with PowerShell global tool to private blob and move to CDN during release (#20659)
  • +
  • Fix release build by making the internal SDK parameter optional (#20658)
  • +
  • Update PSResourceGet version to 1.0.1 (#20652)
  • +
  • Make internal .NET SDK URL as a parameter for release builld (#20655)
  • +
  • Fix setting of variable to consume internal SDK source (#20644)
  • +
  • Bump Microsoft.Management.Infrastructure to v3.0.0 (#20642)
  • +
  • Bump Microsoft.PowerShell.Native to v7.4.0 (#20617)
  • +
  • Bump Microsoft.Security.Extensions from 1.2.0 to 1.3.0 (#20556)
  • +
  • Fix package version for .NET nuget packages (#20551)
  • +
  • Add SBOM for release pipeline (#20519)
  • +
  • Block any preview vPack release (#20243)
  • +
  • Only registry App Path for release package (#20478)
  • +
  • Increase timeout when publishing packages to pacakages.microsoft.com (#20470)
  • +
  • Fix alpine tar package name and do not crossgen alpine fxdependent package (#20459)
  • +
  • Bump PSReadLine from 2.2.6 to 2.3.4 (#20305)
  • +
  • Remove the ref folder before running compliance (#20373)
  • +
  • Updates RIDs used to generate component Inventory (#20370)
  • +
  • Bump XunitXml.TestLogger from 3.1.11 to 3.1.17 (#20293)
  • +
  • Update experimental-feature json files (#20335)
  • +
  • Use fxdependent-win-desktop runtime for compliance runs (#20326)
  • +
  • Release build: Change the names of the PATs (#20307)
  • +
  • Add mapping for mariner arm64 stable (#20213)
  • +
  • Put the calls to Set-AzDoProjectInfo and Set-AzDoAuthToken in the right order (#20306)
  • +
  • Enable vPack provenance data (#20220)
  • +
  • Bump actions/checkout from 3 to 4 (#20205)
  • +
  • Start using new packages.microsoft.com cli (#20140, #20141)
  • +
  • Add mariner arm64 to PMC release (#20176)
  • +
  • Fix typo donet to dotnet in build scripts and pipelines (#20122) (Thanks @0o001!)
  • +
  • Install the pmc cli
  • +
  • Add skip publish parameter
  • +
  • Add verbose to clone
  • +
+ +
+ +### Documentation and Help Content + +- Include information about upgrading in README (#20993) +- Expand "iff" to "if-and-only-if" in XML doc content (#20852) +- Update LTS links in README.md to point to the v7.4 packages (#20839) (Thanks @kilasuit!) +- Update `README.md` to improve readability (#20553) (Thanks @AnkitaSikdar005!) +- Fix link in `docs/community/governance.md` (#20515) (Thanks @suravshresth!) +- Update `ADOPTERS.md` (#20555) (Thanks @AnkitaSikdar005!) +- Fix a typo in `ADOPTERS.md` (#20504, #20520) (Thanks @shruti-sen2004!) +- Correct grammatical errors in `README.md` (#20509) (Thanks @alienishi!) +- Add 7.3 changelog URL to Readme (#20473) (Thanks @Saibamen!) +- Clarify some comments and documentation (#20462) (Thanks @darkstar!) + +[7.5.0-preview.1]: https://github.com/PowerShell/PowerShell/compare/v7.4.1...v7.5.0-preview.1 From dd598b3d527a03f4874d28b1e8aac19566d7aeb2 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 18 Jan 2024 14:58:26 -0800 Subject: [PATCH 0208/1168] Update `README.md` and `metadata.json` for v7.5.0-preview.1 release (#21094) --- README.md | 28 ++++++++++++++-------------- tools/metadata.json | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 7b5fbb0ba6c..1ce032edd86 100644 --- a/README.md +++ b/README.md @@ -93,20 +93,20 @@ You can also download the PowerShell binary archives for Windows, macOS, and Lin [rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-linux-arm64.tar.gz [rl-snap]: https://snapcraft.io/powershell -[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/PowerShell-7.4.0-rc.1-win-x64.msi -[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/PowerShell-7.4.0-rc.1-win-x86.msi -[pv-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-preview_7.4.0-rc.1-1.deb_amd64.deb -[pv-rpm]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-preview-7.4.0_rc.1-1.rh.x86_64.rpm -[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-osx-x64.pkg -[pv-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-osx-arm64.pkg -[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/PowerShell-7.4.0-rc.1-win-arm64.zip -[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/PowerShell-7.4.0-rc.1-win-x86.zip -[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/PowerShell-7.4.0-rc.1-win-x64.zip -[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-osx-x64.tar.gz -[pv-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-osx-arm64.tar.gz -[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-linux-x64.tar.gz -[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-linux-arm32.tar.gz -[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-rc.1/powershell-7.4.0-rc.1-linux-arm64.tar.gz +[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/PowerShell-7.5.0-preview.1-win-x64.msi +[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/PowerShell-7.5.0-preview.1-win-x86.msi +[pv-deb]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/powershell-preview_7.5.0-preview.1-1.deb_amd64.deb +[pv-rpm]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/powershell-preview-7.5.0_preview.1-1.rh.x86_64.rpm +[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/powershell-7.5.0-preview.1-osx-x64.pkg +[pv-macos-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/powershell-7.5.0-preview.1-osx-arm64.pkg +[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/PowerShell-7.5.0-preview.1-win-arm64.zip +[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/PowerShell-7.5.0-preview.1-win-x86.zip +[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/PowerShell-7.5.0-preview.1-win-x64.zip +[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/powershell-7.5.0-preview.1-osx-x64.tar.gz +[pv-macos-tar-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/powershell-7.5.0-preview.1-osx-arm64.tar.gz +[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/powershell-7.5.0-preview.1-linux-x64.tar.gz +[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/powershell-7.5.0-preview.1-linux-arm32.tar.gz +[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.1/powershell-7.5.0-preview.1-linux-arm64.tar.gz [pv-snap]: https://snapcraft.io/powershell-preview [in-windows]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows diff --git a/tools/metadata.json b/tools/metadata.json index 58c3c5280e4..5d37d68a003 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,10 +1,10 @@ { "StableReleaseTag": "v7.4.1", - "PreviewReleaseTag": "v7.4.0-rc.1", + "PreviewReleaseTag": "v7.5.0-preview.1", "ServicingReleaseTag": "v7.0.13", "ReleaseTag": "v7.4.1", "LTSReleaseTag" : ["v7.2.18", "v7.4.1"], - "NextReleaseTag": "v7.5.0-preview.1", + "NextReleaseTag": "v7.5.0-preview.2", "LTSRelease": { "Latest": false, "Package": false }, "StableRelease": { "Latest": false, "Package": false } } From 4f02a89906a92f684ff4511ae74958f602edf800 Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Wed, 24 Jan 2024 03:41:18 +0000 Subject: [PATCH 0209/1168] Fix Get-Error serialization of array values (#21085) Ensure Get-Error does not hang when attempting to serialize an exception that contains a property whose type is an array of System.Type instances. Also ensures that primitive types like System.Int32, System.Boolean as well as System.String is formatted as a string rather than an object with properties. --- .../PowerShellCore_format_ps1xml.cs | 21 +++- .../Get-Error.Tests.ps1 | 107 ++++++++++++++++++ 2 files changed, 125 insertions(+), 3 deletions(-) create mode 100644 test/powershell/Modules/Microsoft.PowerShell.Core/Get-Error.Tests.ps1 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 182af55d641..8bc6b1971cf 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs @@ -946,14 +946,29 @@ private static IEnumerable ViewsOf_System_Management_Autom $isFirstElement = $true foreach ($value in $prop.Value) { $null = $output.Append($newline) - if (!$isFirstElement) { - $null = $output.Append($newline) + $valueIndent = ' ' * ($newIndent + 2) + + if ($value -is [Type]) { + # Just show the typename instead of it as an object + $null = $output.Append(""${prefix}${valueIndent}[$($value.ToString())]"") + } + elseif ($value -is [string] -or $value.GetType().IsPrimitive) { + $null = $output.Append(""${prefix}${valueIndent}${value}"") + } + else { + if (!$isFirstElement) { + $null = $output.Append($newline) + } + $null = $output.Append((Show-ErrorRecord $value $newIndent ($depth + 1))) } - $null = $output.Append((Show-ErrorRecord $value $newIndent ($depth + 1))) $isFirstElement = $false } } } + elseif ($prop.Value -is [Type]) { + # Just show the typename instead of it as an object + $null = $output.Append(""[$($prop.Value.ToString())]"") + } # Anything else, we convert to string. # ToString() can throw so we use LanguagePrimitives.TryConvertTo() to hide a convert error else { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Error.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Error.Tests.ps1 new file mode 100644 index 00000000000..9bec24f302e --- /dev/null +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Error.Tests.ps1 @@ -0,0 +1,107 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +Describe "Get-Error" -Tags "CI" { + It "Does not hang when serializing exception with array with type instances" { + $ps = [PowerShell]::Create() + $null = $ps.AddScript(@' + class GetErrorWithTypeArray : Exception { + [type[]]$Values + [type]$Type + + GetErrorWithTypeArray ([string]$Message) : base($Message) { + $this.Values = [type[]]@([string], [int]) + $this.Type = [bool] + } + } + try { throw [GetErrorWithTypeArray]::new("") } catch {} + Get-Error | Out-String +'@) + + $task = $ps.BeginInvoke() + if (-not $task.AsyncWaitHandle.WaitOne(5000)) { + $null = $ps.BeginStop($null, $null) + throw "Timed out waiting for Get-Error to serialize" + } + + $result = $ps.EndInvoke($task) + $result.Count | Should -Be 1 + $result[0] | Should -BeOfType ([string]) + + $formattedError = (@( + $result[0] -split "\r?\n" | ForEach-Object { + $_.TrimEnd() + } + ) -join ([Environment]::NewLine)).Trim() + + $formattedError | Should -Be @' +Exception : + Values : + [System.String] + [System.Int32] + Type : [System.Boolean] + HResult : -2146233088 +CategoryInfo : OperationStopped: (:) [], GetErrorWithTypeArray +InvocationInfo : + ScriptLineNumber : 10 + OffsetInLine : 19 + HistoryId : 1 + Line : try { throw [GetErrorWithTypeArray]::new("") } catch {} + + Statement : throw [GetErrorWithTypeArray]::new("") + PositionMessage : At line:10 char:19 + + try { throw [GetErrorWithTypeArray]::new("") } catch {} + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CommandOrigin : Internal +ScriptStackTrace : at , : line 10 +'@.Trim() + } + + It "Formats strings and primitive types in an array" { + $ps = [PowerShell]::Create() + $null = $ps.AddScript(@' + class GetErrorPrimitiveArray : Exception { + [object[]]$Values + + GetErrorPrimitiveArray ([string]$Message) : base($Message) { + $this.Values = @(1, "alpha", 0.5) + } + } + try { throw [GetErrorPrimitiveArray]::new("") } catch {} + Get-Error | Out-String +'@) + + $result = $ps.Invoke() + $result.Count | Should -Be 1 + $result[0] | Should -BeOfType ([string]) + + $formattedError = (@( + $result[0] -split "\r?\n" | ForEach-Object { + $_.TrimEnd() + } + ) -join ([Environment]::NewLine)).Trim() + + $formattedError | Should -Be @' +Exception : + Type : GetErrorPrimitiveArray + Values : + 1 + alpha + 0.5 + HResult : -2146233088 +CategoryInfo : OperationStopped: (:) [], GetErrorPrimitiveArray +InvocationInfo : + ScriptLineNumber : 8 + OffsetInLine : 19 + HistoryId : 1 + Line : try { throw [GetErrorPrimitiveArray]::new("") } catch {} + + Statement : throw [GetErrorPrimitiveArray]::new("") + PositionMessage : At line:8 char:19 + + try { throw [GetErrorPrimitiveArray]::new("") } catch {} + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CommandOrigin : Internal +ScriptStackTrace : at , : line 8 +'@.Trim() + } +} From 783fb46e659382e4398896e235a2be647d76d85a Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 1 Feb 2024 09:42:37 -0800 Subject: [PATCH 0210/1168] Validate the value for `using namespace` during semantic checks to prevent declaring invalid namespaces (#21162) --- .../engine/parser/SemanticChecks.cs | 45 ++++++++++++++++--- .../resources/ParserStrings.resx | 3 ++ .../Language/Parser/UsingNamespace.Tests.ps1 | 5 ++- 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/SemanticChecks.cs b/src/System.Management.Automation/engine/parser/SemanticChecks.cs index b108e6330b4..20d0a552cfa 100644 --- a/src/System.Management.Automation/engine/parser/SemanticChecks.cs +++ b/src/System.Management.Automation/engine/parser/SemanticChecks.cs @@ -8,6 +8,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Text; +using System.Text.RegularExpressions; using Microsoft.PowerShell; using System.Management.Automation.Security; @@ -17,7 +18,7 @@ namespace System.Management.Automation.Language { - internal sealed class SemanticChecks : AstVisitor2, IAstPostVisitHandler + internal sealed partial class SemanticChecks : AstVisitor2, IAstPostVisitHandler { private readonly Parser _parser; @@ -1319,20 +1320,50 @@ public override AstVisitAction VisitScriptBlockExpression(ScriptBlockExpressionA public override AstVisitAction VisitUsingStatement(UsingStatementAst usingStatementAst) { - bool usingKindSupported = usingStatementAst.UsingStatementKind == UsingStatementKind.Namespace || - usingStatementAst.UsingStatementKind == UsingStatementKind.Assembly || - usingStatementAst.UsingStatementKind == UsingStatementKind.Module; - if (!usingKindSupported || - usingStatementAst.Alias != null) + UsingStatementKind kind = usingStatementAst.UsingStatementKind; + bool usingKindSupported = kind is UsingStatementKind.Namespace or UsingStatementKind.Assembly or UsingStatementKind.Module; + if (!usingKindSupported || usingStatementAst.Alias != null) { - _parser.ReportError(usingStatementAst.Extent, + _parser.ReportError( + usingStatementAst.Extent, nameof(ParserStrings.UsingStatementNotSupported), ParserStrings.UsingStatementNotSupported); } + if (kind is UsingStatementKind.Namespace) + { + Regex nsPattern = NamespacePattern(); + if (!nsPattern.IsMatch(usingStatementAst.Name.Value)) + { + _parser.ReportError( + usingStatementAst.Name.Extent, + nameof(ParserStrings.InvalidNamespaceValue), + ParserStrings.InvalidNamespaceValue); + } + } + return AstVisitAction.Continue; } + /// + /// This regular expression is for validating if a namespace string is valid. + /// + /// In C#, a legit namespace is defined as `identifier ('.' identifier)*` [see https://learn.microsoft.com/dotnet/csharp/language-reference/language-specification/namespaces#143-namespace-declarations]. + /// And `identifier` is defined in https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/identifier-names#naming-rules, summarized below: + /// - Identifiers must start with a letter or underscore (_). + /// - Identifiers can contain + /// * Unicode letter characters (categories: Lu, Ll, Lt, Lm, Lo or Nl); + /// * decimal digit characters (category: Nd); + /// * Unicode connecting characters (category: Pc); + /// * Unicode combining characters (categories: Mn, Mc); + /// * Unicode formatting characters (category: Cf). + /// + /// For details about how Unicode categories are represented in regular expression, see the "Unicode Categories" section in the following article: + /// - https://www.regular-expressions.info/unicode.html + /// + [GeneratedRegex(@"^[\p{L}\p{Nl}_][\p{L}\p{Nl}\p{Nd}\p{Pc}\p{Mn}\p{Mc}\p{Cf}_]*(?:\.[\p{L}\p{Nl}_][\p{L}\p{Nl}\p{Nd}\p{Pc}\p{Mn}\p{Mc}\p{Cf}_]*)*$")] + private static partial Regex NamespacePattern(); + public override AstVisitAction VisitConfigurationDefinition(ConfigurationDefinitionAst configurationDefinitionAst) { // diff --git a/src/System.Management.Automation/resources/ParserStrings.resx b/src/System.Management.Automation/resources/ParserStrings.resx index a45a5165b03..aaf7d758608 100644 --- a/src/System.Management.Automation/resources/ParserStrings.resx +++ b/src/System.Management.Automation/resources/ParserStrings.resx @@ -1229,6 +1229,9 @@ ModuleVersion : Version of module to import. If used, ModuleName must represent This syntax of the 'using' statement is not supported. + + The specified namespace in the 'using' statement contains invalid characters. + information stream diff --git a/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 b/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 index 58d9b8738cc..0370a8c5e1d 100644 --- a/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 +++ b/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 @@ -128,7 +128,10 @@ Describe "Using Namespace" -Tags "CI" { ShouldBeParseError "1; using namespace System" UsingMustBeAtStartOfScript 3 ShouldBeParseError "using namespace Foo = System" UsingStatementNotSupported 0 + ShouldBeParseError "using namespace ''" InvalidNamespaceValue 16 + ShouldBeParseError "using namespace [System]" InvalidNamespaceValue 16 + ShouldBeParseError "using namespace ',System'" InvalidNamespaceValue 16 + ShouldBeParseError "using namespace ']System'" InvalidNamespaceValue 16 # TODO: add diagnostic (low pri) # ShouldBeParseError "using namespace System; using namespace System" UsingNamespaceAlreadySpecified 24 } - From e9682c151d78502d63ce60584484e1b5dbed5c96 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Thu, 1 Feb 2024 09:49:20 -0800 Subject: [PATCH 0211/1168] Fix `using assembly` to use `Path.Combine` when constructing assembly paths (#21169) --- .../engine/parser/Compiler.cs | 2 +- .../engine/parser/Parser.cs | 2 +- .../Language/Parser/UsingAssembly.Tests.ps1 | 74 +++++++++---------- 3 files changed, 36 insertions(+), 42 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 3fac9de74f6..c9cc5a3f6d0 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -2801,7 +2801,7 @@ private static Assembly LoadAssembly(string assemblyName, string scriptFileName) { if (!string.IsNullOrEmpty(scriptFileName) && !Path.IsPathRooted(assemblyFileName)) { - assemblyFileName = Path.GetDirectoryName(scriptFileName) + "\\" + assemblyFileName; + assemblyFileName = Path.Combine(Path.GetDirectoryName(scriptFileName), assemblyFileName); } if (File.Exists(assemblyFileName)) diff --git a/src/System.Management.Automation/engine/parser/Parser.cs b/src/System.Management.Automation/engine/parser/Parser.cs index a21fcc1aafa..45529b2de8f 100644 --- a/src/System.Management.Automation/engine/parser/Parser.cs +++ b/src/System.Management.Automation/engine/parser/Parser.cs @@ -5133,7 +5133,7 @@ private StringConstantExpressionAst ResolveUsingAssembly(StringConstantExpressio workingDirectory = Path.GetDirectoryName(scriptFileName); } - assemblyFileName = workingDirectory + @"\" + assemblyFileName; + assemblyFileName = Path.Combine(workingDirectory, assemblyFileName); } } catch diff --git a/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 b/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 index caf7af1551f..6ff7896041e 100644 --- a/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 +++ b/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 @@ -44,24 +44,15 @@ public class ABC {} $err[0].ErrorId | Should -Be CannotLoadAssemblyWithUriSchema } - It "parse does not load the assembly" -Pending { + It "parse does not load the assembly '