From 3e8092d89910f534ee06daf041a37ab9dcf21c71 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 11 Jul 2023 16:38:04 -0700 Subject: [PATCH 01/10] Change `System.Security.AccessControl` preview version to stable version (#19931) --- .../System.Management.Automation.csproj | 2 +- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- .../System.Management.Automation.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index f3c3f8f0216..5f6dd5ea79d 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -26,7 +26,7 @@ - + diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 68f76d27aa9..c0917f4ca32 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -14,7 +14,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 862cf1ddff8..b9bb9b71e08 100644 --- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj +++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj @@ -9,6 +9,6 @@ - + From 351092f53c559634a20518301bf4509934de5112 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 12 Jul 2023 12:55:54 -0700 Subject: [PATCH 02/10] Update the link for getting started in `README.md` (#19932) (#19947) Co-authored-by: Aditya Patwardhan --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 49061b9d33a..248814ef0a6 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ It includes a command-line shell, an associated scripting language and a framewo ## Windows PowerShell vs. PowerShell Core -Although this repository started as a fork of the Windows PowerShell code base, 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 do not make their way back to Windows PowerShell 5.1 automatically. 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. @@ -20,7 +20,7 @@ Windows PowerShell specific issues should be reported with the [Feedback Hub app If you are new to PowerShell and would like to learn more, we recommend reviewing the [getting started][] documentation. -[getting started]: https://github.com/PowerShell/PowerShell/tree/master/docs/learning-powershell +[getting started]: https://learn.microsoft.com/powershell/scripting/learn/more-powershell-learning ## Get PowerShell From 67025f1fa18ff387de7ef3e52bf12d1cbaf8671e Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 12 Jul 2023 14:13:22 -0700 Subject: [PATCH 03/10] Change variable used to bypass nuget security scanning (#19953) --- tools/releaseBuild/azureDevOps/compliance.yml | 2 ++ tools/releaseBuild/azureDevOps/releaseBuild.yml | 2 ++ .../templates/insert-nuget-config-azfeed.yml | 17 +++++++++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/compliance.yml b/tools/releaseBuild/azureDevOps/compliance.yml index 43ef005402b..57c29194de6 100644 --- a/tools/releaseBuild/azureDevOps/compliance.yml +++ b/tools/releaseBuild/azureDevOps/compliance.yml @@ -24,6 +24,8 @@ variables: value: 1 - name: POWERSHELL_TELEMETRY_OPTOUT value: 1 + - name: nugetMultiFeedWarnLevel + value: none - name: NugetSecurityAnalysisWarningLevel value: none # Defines the variables AzureFileCopySubscription, StorageAccount, StorageAccountKey, StorageResourceGroup, StorageSubscriptionName diff --git a/tools/releaseBuild/azureDevOps/releaseBuild.yml b/tools/releaseBuild/azureDevOps/releaseBuild.yml index 02b0f1cd4af..c71616137c8 100644 --- a/tools/releaseBuild/azureDevOps/releaseBuild.yml +++ b/tools/releaseBuild/azureDevOps/releaseBuild.yml @@ -32,6 +32,8 @@ variables: value: 1 - name: POWERSHELL_TELEMETRY_OPTOUT value: 1 + - name: nugetMultiFeedWarnLevel + value: none - name: NugetSecurityAnalysisWarningLevel value: none # Prevents auto-injection of nuget-security-analysis@0 diff --git a/tools/releaseBuild/azureDevOps/templates/insert-nuget-config-azfeed.yml b/tools/releaseBuild/azureDevOps/templates/insert-nuget-config-azfeed.yml index 3ba642407ce..3ff723be6ed 100644 --- a/tools/releaseBuild/azureDevOps/templates/insert-nuget-config-azfeed.yml +++ b/tools/releaseBuild/azureDevOps/templates/insert-nuget-config-azfeed.yml @@ -4,25 +4,34 @@ parameters: steps: - pwsh: | + $configPath = "${env:NugetConfigDir}/nuget.config" Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force - New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT2) -FeedName AzDevOpsFeed -Destination '${{ parameters.repoRoot }}/src/Modules' + New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT2) -FeedName AzDevOpsFeed -Destination "${env:NugetConfigDir}" - if(-not (Test-Path "${{ parameters.repoRoot }}/src/Modules/nuget.config")) + 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 PSGallery modules' condition: and(succeededOrFailed(), ne(variables['AzDevOpsFeed'], '')) + env: + NugetConfigDir: ${{ parameters.repoRoot }}/src/Modules + - pwsh: | + $configPath = "${env:NugetConfigDir}/nuget.config" Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force - New-NugetConfigFile -NugetFeedUrl $(PSInternalNugetFeed) -UserName $(PSInternalNugetFeedUserName) -ClearTextPAT $(PSInternalNugetFeedPAT) -FeedName AzDevOpsFeed -Destination '${{ parameters.repoRoot }}' + New-NugetConfigFile -NugetFeedUrl $(PSInternalNugetFeed) -UserName $(PSInternalNugetFeedUserName) -ClearTextPAT $(PSInternalNugetFeedPAT) -FeedName AzDevOpsFeed -Destination "${env:NugetConfigDir}" - if(-not (Test-Path "${{ parameters.repoRoot }}/nuget.config")) + 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'], '')) + env: + NugetConfigDir: ${{ parameters.repoRoot }} - task: nuget-security-analysis@0 displayName: 'Run Secure Supply Chain analysis' From 0e4c714e0e3fa4241eaf1c2026cbdbdceb4d5c53 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 12 Jul 2023 14:31:56 -0700 Subject: [PATCH 04/10] Add ProductCode in registry for MSI install (#19951) * Add ProductCode in registry for MSI install * Add test for validating ProductCode regkey is created * Add test better validation Co-authored-by: Aditya Patwardhan --- assets/wix/Product.wxs | 2 ++ test/packaging/windows/msi.tests.ps1 | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/assets/wix/Product.wxs b/assets/wix/Product.wxs index 8dc2d3a3f16..8373130ccc9 100644 --- a/assets/wix/Product.wxs +++ b/assets/wix/Product.wxs @@ -203,7 +203,9 @@ + + diff --git a/test/packaging/windows/msi.tests.ps1 b/test/packaging/windows/msi.tests.ps1 index 0ee34ca482c..28cedef6edd 100644 --- a/test/packaging/windows/msi.tests.ps1 +++ b/test/packaging/windows/msi.tests.ps1 @@ -144,27 +144,32 @@ Describe -Name "Windows MSI" -Fixture { Write-Verbose "cr-$channel-$runtime" -Verbose $pwshPath = Join-Path $env:ProgramFiles -ChildPath "PowerShell" $pwshx86Path = Join-Path ${env:ProgramFiles(x86)} -ChildPath "PowerShell" + $regKeyPath = "HKLM:\SOFTWARE\Microsoft\PowerShellCore\InstalledVersions" switch ("$channel-$runtime") { "preview-win7-x64" { $versionPath = Join-Path -Path $pwshPath -ChildPath '7-preview' $revisionRange = 0, 99 $msiUpgradeCode = '39243d76-adaf-42b1-94fb-16ecf83237c8' + $regKeyPath = Join-Path $regKeyPath -ChildPath $msiUpgradeCode } "stable-win7-x64" { $versionPath = Join-Path -Path $pwshPath -ChildPath '7' $revisionRange = 500, 500 $msiUpgradeCode = '31ab5147-9a97-4452-8443-d9709f0516e1' + $regKeyPath = Join-Path $regKeyPath -ChildPath $msiUpgradeCode } "preview-win7-x86" { $versionPath = Join-Path -Path $pwshx86Path -ChildPath '7-preview' $revisionRange = 0, 99 $msiUpgradeCode = '86abcfbd-1ccc-4a88-b8b2-0facfde29094' + $regKeyPath = Join-Path $regKeyPath -ChildPath $msiUpgradeCode } "stable-win7-x86" { $versionPath = Join-Path -Path $pwshx86Path -ChildPath '7' $revisionRange = 500, 500 $msiUpgradeCode = '1d00683b-0f84-4db8-a64f-2f98ad42fe06' + $regKeyPath = Join-Path $regKeyPath -ChildPath $msiUpgradeCode } default { throw "'$_' not a valid channel runtime combination" @@ -196,6 +201,27 @@ Describe -Name "Windows MSI" -Fixture { $version.Revision | Should -BeLessOrEqual $revisionRange[1] -Because "$channel revision should between $($revisionRange[0]) and $($revisionRange[1])" } + It 'MSI should add ProductCode in registry' -Skip:(!(Test-Elevated)) { + + $productCode = if ($msiUpgradeCode -eq '39243d76-adaf-42b1-94fb-16ecf83237c8' -or + $msiUpgradeCode -eq '31ab5147-9a97-4452-8443-d9709f0516e1') { + # x64 + $regKeyPath | Should -Exist + Get-ItemPropertyValue -Path $regKeyPath -Name 'ProductCode' + } elseif ($msiUpgradeCode -eq '86abcfbd-1ccc-4a88-b8b2-0facfde29094' -or + $msiUpgradeCode -eq '1d00683b-0f84-4db8-a64f-2f98ad42fe06') { + # x86 - need to open the 32bit reghive + $wow32RegKey = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, [Microsoft.Win32.RegistryView]::Registry32) + $subKey = $wow32RegKey.OpenSubKey("Software\Microsoft\PowerShellCore\InstalledVersions\$msiUpgradeCode") + $subKey.GetValue("ProductCode") + } + + $productCode | Should -Not -BeNullOrEmpty + $productCodeGuid = [Guid]$productCode + $productCodeGuid | Should -BeOfType "Guid" + $productCodeGuid.Guid | Should -Not -Be $msiUpgradeCode + } + It "MSI should uninstall without error" -Skip:(!(Test-Elevated)) { { Invoke-MsiExec -Uninstall -MsiPath $msiX64Path From d4414ce6a123d59c08178da0416cb46f6904ce04 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 12 Jul 2023 14:34:40 -0700 Subject: [PATCH 05/10] Remove the property disabling optimization (#19952) Co-authored-by: Patrick Meinecke --- PowerShell.Common.props | 8 -------- .../CoreCLR/CorePsPlatform.cs | 6 ++++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index 5e7e41f1470..476dd023b1f 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -182,14 +182,6 @@ full - - - - false - - strict diff --git a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs index 1986c4c63be..ef8b88eed42 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs @@ -935,8 +935,10 @@ internal static class NativeMethods [DllImport(psLib)] internal static extern int WaitPid(int pid, bool nohang); - // This is a struct tm from . - [StructLayout(LayoutKind.Sequential)] + // This is the struct `private_tm` from setdate.h in libpsl-native. + // Packing is set to 4 to match the unmanaged declaration. + // https://github.com/PowerShell/PowerShell-Native/blob/c5575ceb064e60355b9fee33eabae6c6d2708d14/src/libpsl-native/src/setdate.h#L23 + [StructLayout(LayoutKind.Sequential, Pack = 4)] internal unsafe struct UnixTm { /// Seconds (0-60). From 0ccff15688e4ec7b8fba8425ad832d430e06209b Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 12 Jul 2023 14:39:46 -0700 Subject: [PATCH 06/10] Bump .NET to 7.0.306 (#19945) --- DotnetRuntimeMetadata.json | 2 +- global.json | 2 +- .../Microsoft.PowerShell.SDK.csproj | 2 +- tools/cgmanifest.json | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json index 303b9f44ee1..13471fa4cbb 100644 --- a/DotnetRuntimeMetadata.json +++ b/DotnetRuntimeMetadata.json @@ -4,7 +4,7 @@ "quality": "daily", "qualityFallback": "preview", "packageVersionPattern": "7.0.0", - "sdkImageVersion": "7.0.305", + "sdkImageVersion": "7.0.306", "nextChannel": "7.0.1xx-rc2", "azureFeed": "", "sdkImageOverride": "" diff --git a/global.json b/global.json index 93ffc6c65b5..de544e70c99 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "7.0.305" + "version": "7.0.306" } } diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 1b30ee1581b..feb7a0e4818 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -17,7 +17,7 @@ - + diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index 6f2cebcece9..30bf5a7d3a9 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { @@ -105,7 +106,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.Extensions.ObjectPool", - "Version": "7.0.7" + "Version": "7.0.9" } }, "DevelopmentDependency": false @@ -205,7 +206,7 @@ "Type": "nuget", "Nuget": { "Name": "Microsoft.Windows.Compatibility", - "Version": "7.0.3" + "Version": "7.0.4" } }, "DevelopmentDependency": false @@ -345,7 +346,7 @@ "Type": "nuget", "Nuget": { "Name": "StyleCop.Analyzers.Unstable", - "Version": "1.2.0.435" + "Version": "1.2.0.507" } }, "DevelopmentDependency": true @@ -655,7 +656,7 @@ "Type": "nuget", "Nuget": { "Name": "System.Security.Cryptography.Pkcs", - "Version": "7.0.2" + "Version": "7.0.3" } }, "DevelopmentDependency": false @@ -840,6 +841,5 @@ }, "DevelopmentDependency": false } - ], - "$schema": "https://json.schemastore.org/component-detection-manifest.json" + ] } From 9bbc770947b4d0bfac59cbc7e6274d11e7c929e9 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 12 Jul 2023 14:45:14 -0700 Subject: [PATCH 07/10] Don't publish notice on failure because it prevent retry --- .../azureDevOps/templates/compliance/generateNotice.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseBuild/azureDevOps/templates/compliance/generateNotice.yml b/tools/releaseBuild/azureDevOps/templates/compliance/generateNotice.yml index 2431ded7448..777fbfb4f5d 100644 --- a/tools/releaseBuild/azureDevOps/templates/compliance/generateNotice.yml +++ b/tools/releaseBuild/azureDevOps/templates/compliance/generateNotice.yml @@ -86,4 +86,4 @@ jobs: targetPath: $(System.ArtifactsDirectory) artifactName: notice displayName: Publish notice artifacts - condition: always() + retryCountOnTaskFailure: 2 From ff55fbf157bc965d9349f47e05b2a15a9cdeee4b Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 12 Jul 2023 22:49:55 +0000 Subject: [PATCH 08/10] Update Notices file --- ThirdPartyNotices.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 80b5d44cc43..ec638519f52 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -229,7 +229,7 @@ SOFTWARE. --------------------------------------------------------- -Microsoft.Extensions.ObjectPool 7.0.7 - MIT +Microsoft.Extensions.ObjectPool 7.0.9 - MIT (c) Microsoft Corporation @@ -587,7 +587,7 @@ SOFTWARE. --------------------------------------------------------- -Microsoft.Windows.Compatibility 7.0.3 - MIT +Microsoft.Windows.Compatibility 7.0.4 - MIT (c) Microsoft Corporation @@ -3416,7 +3416,7 @@ SOFTWARE. --------------------------------------------------------- -System.Security.Cryptography.Pkcs 7.0.2 - MIT +System.Security.Cryptography.Pkcs 7.0.3 - MIT (c) Microsoft Corporation From ec2bcbbbf97dc661f94ca51c08dca2f7462f37c3 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 13 Jul 2023 02:59:19 +0000 Subject: [PATCH 09/10] Change variable used to bypass nuget security scanning --- 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 10796c7a0db..6955e8be127 100644 --- a/tools/releaseBuild/azureDevOps/releasePipeline.yml +++ b/tools/releaseBuild/azureDevOps/releasePipeline.yml @@ -22,6 +22,8 @@ resources: variables: - name: runCodesignValidationInjection value : false + - name: nugetMultiFeedWarnLevel + value: none - name: NugetSecurityAnalysisWarningLevel value: none - name: skipComponentGovernanceDetection From baaad399f1b860da0b2dcf2b749f5bac797fe996 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 13 Jul 2023 22:00:25 +0000 Subject: [PATCH 10/10] Merged PR 26696: Add change log for v7.3.6 Add change log for v7.3.6 --- CHANGELOG/7.3.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/CHANGELOG/7.3.md b/CHANGELOG/7.3.md index 90bb8edb928..7c4a8d755bc 100644 --- a/CHANGELOG/7.3.md +++ b/CHANGELOG/7.3.md @@ -1,5 +1,35 @@ # 7.3 Changelog +## [7.3.6] - 2023-07-13 + +### Build and Packaging Improvements + +
+ + + +

Bump .NET to 7.0.306

+ +
+ +
    +
  • Update Notices file
  • +
  • Don't publish notice on failure because it prevents retry
  • +
  • Bump .NET to 7.0.306 (#19945)
  • +
  • Remove the property disabling optimization (#19952)
  • +
  • Add ProductCode in registry for MSI install (#19951)
  • +
  • Update variable used to bypass the blocking check for multiple NuGet feeds (#19953)
  • +
  • Change System.Security.AccessControl preview version to stable version (#19931)
  • +
+ +
+ +### Documentation and Help Content + +- Update the link for getting started in `README.md` (#19947) + +[7.3.6]: https://github.com/PowerShell/PowerShell/compare/v7.3.5...v7.3.6 + ## [7.3.5] - 2023-06-27 ### Build and Packaging Improvements