WIP [release/v7.5] rebuild based on packages#25894
Closed
TravisEz13 wants to merge 2 commits intoPowerShell:release/v7.5from
Closed
WIP [release/v7.5] rebuild based on packages#25894TravisEz13 wants to merge 2 commits intoPowerShell:release/v7.5from
TravisEz13 wants to merge 2 commits intoPowerShell:release/v7.5from
Conversation
iSazonov
reviewed
Aug 25, 2025
Collaborator
iSazonov
left a comment
There was a problem hiding this comment.
Our dev documentation is very outdated. Have you considered updating it?
Comment on lines
+49
to
+50
| <ProjectReference Include="..\Microsoft.PowerShell.SDK\Microsoft.PowerShell.SDK.csproj" /> | ||
| <PackageReference Include="Microsoft.PowerShell.SDK" Version="7.5.2" /> |
Collaborator
There was a problem hiding this comment.
Repeat project reference.
| <PackageReference Include="Microsoft.PowerShell.ConsoleHost" Version="7.5.2" /> | ||
| <PackageReference Include="Microsoft.PowerShell.Commands.Diagnostics" Version="7.5.2" /> | ||
| <PackageReference Include="Microsoft.Management.Infrastructure.CimCmdlets" Version="7.5.2" /> | ||
| <PackageReference Include="Microsoft.WSMan.Management" Version="7.5.2" /> |
Collaborator
There was a problem hiding this comment.
Should we parameterize this 7.5.2 value? It is used in many places.
…arios in PowerShell projects
… and conditional xUnit test execution
Contributor
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new build mode that allows building PowerShell modules and SDKs from pre-built packages instead of project references, controlled by a new
BuildFromPackagesswitch and theRebuildMSBuild property. This change streamlines the build process, especially for scenarios where consuming official package releases is preferred over local source builds. The implementation involves conditional logic in the build scripts and project files to switch between package references and project references based on the build mode.Build system enhancements:
BuildFromPackagesswitch to theStart-PSBuildfunction inbuild.psm1, which sets the/property:Rebuild=trueMSBuild property to control package-based builds. [1] [2]Module.Common.propsfile that conditionally includes eitherPackageReferenceorProjectReferenceforSystem.Management.Automationdepending on theRebuildproperty and platform, centralizing this logic for multiple projects.Project file conditional references:
.csprojfiles (such asMicrosoft.PowerShell.Commands.Management,Microsoft.PowerShell.Commands.Utility,Microsoft.PowerShell.Security, andMicrosoft.PowerShell.SDK) to importModule.Common.propsand/or conditionally switch between package and project references based on theRebuildproperty. This includes adding or moving relevantPackageReferenceandProjectReferenceentries. [1] [2] [3] [4] [5] [6]Windows-specific build logic:
Module.Common.props, added special handling for Windows builds by including a direct assembly reference toSystem.Management.Automation.dllfrom the NuGet package when rebuilding on Windows.SDK and host packaging:
powershell-win-core.csprojto use package references for SDK and related modules when in rebuild mode, and project references otherwise, aligning the packaging with the new build strategy.Graphical host build adjustments:
Microsoft.PowerShell.GraphicalHost.csprojto use package references for dependencies when rebuilding, and project references otherwise, supporting the new build mode.These changes collectively enable a more flexible build process, allowing developers and CI systems to choose between source-based and package-based builds as needed.