From c3f139e31308d61686d808b0a629c8263342c2db Mon Sep 17 00:00:00 2001 From: Justin Chung Date: Thu, 16 Jul 2026 17:04:16 +0000 Subject: [PATCH 1/2] Merged PR 40640: [release/v7.6.4] Backport Windows build pipeline fixes Backports the build fixes from mscodehub PRs 40633 and 40638 to `release/v7.6.4`. ## Scope - Replays PR 40633's prerequisite chain: PR 40625, PR 40632, then PR 40633. - Cherry-picks the current source commit from PR 40638 (`f507709e175428305a9bd17d816c0a1ab9b40c28`). - Changes only `tools/wix/wix.psm1` and `tools/packaging/packaging.psm1`. ## Changes - Ensures Microsoft.PowerShell.PSResourceGet 1.2.0 or newer is available, installing it from an explicitly registered PowerShell CFS v2 feed when necessary. - Adds `-sval` to the WiX `light.exe` invocation to skip ICE validation in CI. ## Source PRs - [40625](https://dev.azure.com/mscodehub/PowerShellCore/_git/PowerShell/pullrequest/40625) - [40632](https://dev.azure.com/mscodehub/PowerShellCore/_git/PowerShell/pullrequest/40632) - [40633](https://dev.azure.com/mscodehub/PowerShellCore/_git/PowerShell/pullrequest/40633) - [40638](https://dev.azure.com/mscodehub/PowerShellCore/_git/PowerShell/pullrequest/40638) ## Validation - Each backport commit has the same stable patch ID as its source commit. - Both changed PowerShell modules parse without errors. - The branch diff passes `git diff --check`. ## Repository boundary This branch and PR must remain in `mscodehub`; do not mirror or push this branch to GitHub before the PowerShell 7.6.4 release. ---- #### AI description (iteration 1) #### PR Classification Bug fixes for Windows build pipeline to resolve WiX tooling installation and MSI build validation issues. #### PR Summary This pull request addresses critical issues in the Windows build pipeline by fixing the WiX module installation process and MSI build validation. The changes ensure proper version checking for PSResourceGet module and suppress schema validation during MSI builds. - `/tools/wix/wix.psm1`: Added version check for PSResourceGet (minimum v1.2.0), implemented custom PSRepository registration for reliable module installation, and improved error handling with try-finally block - `/tools/packaging/packaging.psm1`: Added `-sval` flag to suppress schema validation during WiX Light execution to prevent build failures - `/tools/packaging/packaging.psm1`: Minor whitespace cleanup for code formatting consistency --- tools/packaging/packaging.psm1 | 10 +++++----- tools/wix/wix.psm1 | 14 ++++++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 1052d95e49c..eb0bddc49c3 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -2370,12 +2370,12 @@ function Get-MacOSPackageIdentifierInfo param( [Parameter(Mandatory)] [string]$Version, - + [switch]$LTS ) - + $IsPreview = Test-IsPreview -Version $Version -IsLTS:$LTS - + # Determine package identifier based on preview status if ($IsPreview) { $PackageIdentifier = 'com.microsoft.powershell-preview' @@ -2383,7 +2383,7 @@ function Get-MacOSPackageIdentifierInfo else { $PackageIdentifier = 'com.microsoft.powershell' } - + return @{ IsPreview = $IsPreview PackageIdentifier = $PackageIdentifier @@ -4204,7 +4204,7 @@ function Start-MsiBuild { # suppress ICE61, because we allow same version upgrades # suppress ICE57, this suppresses an error caused by our shortcut not being installed per user # suppress ICE40, REINSTALLMODE is defined in the Property table. - Start-NativeExecution -VerboseOutputOnError {& $wixPaths.wixLightExePath -sice:ICE61 -sice:ICE40 -sice:ICE57 -out $msiLocationPath -pdbout $msiPdbLocationPath $objectPaths $extensionArgs } + Start-NativeExecution -VerboseOutputOnError {& $wixPaths.wixLightExePath -sval -sice:ICE61 -sice:ICE40 -sice:ICE57 -out $msiLocationPath -pdbout $msiPdbLocationPath $objectPaths $extensionArgs } foreach($file in $objectPaths) { diff --git a/tools/wix/wix.psm1 b/tools/wix/wix.psm1 index a18bb9efc19..e58379aef9d 100644 --- a/tools/wix/wix.psm1 +++ b/tools/wix/wix.psm1 @@ -36,10 +36,16 @@ function Install-Wix } $binPath = Join-Path -Path $targetRoot -ChildPath 'bin' - $psresourceGet = Get-Module -ListAvailable -Name 'Microsoft.PowerShell.PSResourceGet' -ErrorAction SilentlyContinue - - if (-not $psresourceGet) { - Install-Module -Name 'Microsoft.PowerShell.PSResourceGet' -Force -AllowClobber -Scope CurrentUser + $psresourceGet = Get-Module -ListAvailable -Name 'Microsoft.PowerShell.PSResourceGet' -ErrorAction SilentlyContinue | Select-Object -First 1 + + if (-not $psresourceGet -or $psresourceGet.Version -lt [version]"1.2.0") { + try { + Register-PSRepository -Name 'powershell-cfs' -SourceLocation 'https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShell/nuget/v2' -InstallationPolicy Trusted + Install-Module -Name 'Microsoft.PowerShell.PSResourceGet' -Force -AllowClobber -Scope CurrentUser -Repository 'powershell-cfs' + } + finally { + Unregister-PSRepository -Name 'powershell-cfs' + } } $respository = Get-PSResourceRepository -Name 'dotnet-eng' -ErrorAction SilentlyContinue From 9657d9525c7162467f45f562c0e1a3c94f2ccfeb Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 11 Aug 2026 15:11:01 +0000 Subject: [PATCH 2/2] Merged PR 41087: Import LINQ for RunspaceConnectionInfo (#173) Import LINQ for RunspaceConnectionInfo (#173) ---- #### AI description (iteration 1) #### PR Classification Code cleanup to add a missing namespace import for LINQ functionality. #### PR Summary This pull request adds the `System.Linq` namespace import to the `RunspaceConnectionInfo.cs` file to resolve a missing dependency. - `RunspaceConnectionInfo.cs`: Added `using System.Linq;` directive to import LINQ namespace --- .../engine/remoting/common/RunspaceConnectionInfo.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs index 0c99f90fa7e..25ecb1880c6 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs @@ -14,6 +14,7 @@ using System.Management.Automation.Remoting.Client; using System.Management.Automation.Tracing; using System.Net; +using System.Linq; using System.Net.Sockets; using System.Reflection; using System.Runtime.InteropServices;