From a1ca5743cf8f4e23fd3d8eb9edb703a3884eb54a Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 18 Mar 2026 18:02:11 +0000
Subject: [PATCH 1/4] Move _GetDependencies MSBuild target from build.psm1 into
Microsoft.PowerShell.SDK.csproj
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
---
build.psm1 | 21 -------------------
.../Microsoft.PowerShell.SDK.csproj | 18 ++++++++++++++++
2 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/build.psm1 b/build.psm1
index ee50c9cde51..aca981b2e3f 100644
--- a/build.psm1
+++ b/build.psm1
@@ -2681,27 +2681,6 @@ function Start-TypeGen
# Add .NET CLI tools to PATH
Find-Dotnet
- # This custom target depends on 'ResolveAssemblyReferencesDesignTime', whose definition can be found in the sdk folder.
- # To find the available properties of '_ReferencesFromRAR' when switching to a new dotnet sdk, follow the steps below:
- # 1. create a dummy project using the new dotnet sdk.
- # 2. build the dummy project with this command:
- # dotnet msbuild .\dummy.csproj /t:ResolveAssemblyReferencesDesignTime /fileLogger /noconsolelogger /v:diag
- # 3. search '_ReferencesFromRAR' in the produced 'msbuild.log' file. You will find the properties there.
- $GetDependenciesTargetPath = "$PSScriptRoot/src/Microsoft.PowerShell.SDK/obj/Microsoft.PowerShell.SDK.csproj.TypeCatalog.targets"
- $GetDependenciesTargetValue = @'
-
-
-
- <_RefAssemblyPath Include="%(_ReferencesFromRAR.OriginalItemSpec)%3B" Condition=" '%(_ReferencesFromRAR.NuGetPackageId)' != 'Microsoft.Management.Infrastructure' "/>
-
-
-
-
-'@
- New-Item -ItemType Directory -Path (Split-Path -Path $GetDependenciesTargetPath -Parent) -Force > $null
- Set-Content -Path $GetDependenciesTargetPath -Value $GetDependenciesTargetValue -Force -Encoding Ascii
-
Push-Location "$PSScriptRoot/src/Microsoft.PowerShell.SDK"
try {
$ps_inc_file = "$PSScriptRoot/src/TypeCatalogGen/$IncFileName"
diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj
index 5f680de58dc..d0909461435 100644
--- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj
+++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj
@@ -31,4 +31,22 @@
+
+
+
+ <_RefAssemblyPath Include="%(_ReferencesFromRAR.OriginalItemSpec)%3B" Condition=" '%(_ReferencesFromRAR.NuGetPackageId)' != 'Microsoft.Management.Infrastructure' "/>
+
+
+
+
From e5ce836a8e29b215fdea0e5f37287d9036a469a6 Mon Sep 17 00:00:00 2001
From: Travis Plunk
Date: Wed, 18 Mar 2026 14:21:33 -0400
Subject: [PATCH 2/4] Update Microsoft.PowerShell.SDK.csproj with new contents
---
.../Microsoft.PowerShell.SDK.csproj | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj
index d0909461435..3859c51a01e 100644
--- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj
+++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj
@@ -44,9 +44,13 @@
+
<_RefAssemblyPath Include="%(_ReferencesFromRAR.OriginalItemSpec)%3B" Condition=" '%(_ReferencesFromRAR.NuGetPackageId)' != 'Microsoft.Management.Infrastructure' "/>
-
+
\ No newline at end of file
From eabd8991541c00f0b3b0456339d80e027b657358 Mon Sep 17 00:00:00 2001
From: Travis Plunk
Date: Wed, 18 Mar 2026 14:23:27 -0400
Subject: [PATCH 3/4] Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---
src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj
index 3859c51a01e..979764ff79f 100644
--- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj
+++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj
@@ -38,7 +38,7 @@
To find the available properties of '_ReferencesFromRAR' when switching to a new dotnet sdk:
1. Create a dummy project using the new dotnet sdk.
2. Build the dummy project with:
- dotnet msbuild .\dummy.csproj /t:ResolveAssemblyReferencesDesignTime /fileLogger /noconsolelogger /v:diag
+ dotnet msbuild ./dummy.csproj /t:ResolveAssemblyReferencesDesignTime /fileLogger /noconsolelogger /v:diag
3. Search '_ReferencesFromRAR' in the produced 'msbuild.log' file.
-->
Date: Wed, 18 Mar 2026 18:26:18 +0000
Subject: [PATCH 4/4] Wrap dotnet calls in Start-TypeGen with
Start-NativeExecution; fix cross-platform path in comment
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
---
build.psm1 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/build.psm1 b/build.psm1
index aca981b2e3f..ec91f2cf314 100644
--- a/build.psm1
+++ b/build.psm1
@@ -2684,14 +2684,14 @@ function Start-TypeGen
Push-Location "$PSScriptRoot/src/Microsoft.PowerShell.SDK"
try {
$ps_inc_file = "$PSScriptRoot/src/TypeCatalogGen/$IncFileName"
- dotnet msbuild .\Microsoft.PowerShell.SDK.csproj /t:_GetDependencies "/property:DesignTimeBuild=true;_DependencyFile=$ps_inc_file" /nologo
+ Start-NativeExecution { dotnet msbuild .\Microsoft.PowerShell.SDK.csproj /t:_GetDependencies "/property:DesignTimeBuild=true;_DependencyFile=$ps_inc_file" /nologo }
} finally {
Pop-Location
}
Push-Location "$PSScriptRoot/src/TypeCatalogGen"
try {
- dotnet run ../System.Management.Automation/CoreCLR/CorePsTypeCatalog.cs $IncFileName
+ Start-NativeExecution { dotnet run ../System.Management.Automation/CoreCLR/CorePsTypeCatalog.cs $IncFileName }
} finally {
Pop-Location
}