Skip to content

Conversation

@PrzemyslawKlys
Copy link
Member

@PrzemyslawKlys PrzemyslawKlys commented Oct 28, 2025

This pull request introduces several documentation and code improvements related to handling versioning in C# projects and PowerShell modules, as well as enhancements to assembly metadata extraction. The most significant changes include expanding support for version detection and updating in .csproj files, refactoring documentation for clarity and completeness, and improving robustness in PowerShell assembly metadata analysis.

Versioning improvements in C# project handling:

  • The logic for detecting the current version in .csproj files now checks multiple tags in order of precedence: VersionPrefix, Version, PackageVersion, AssemblyVersion, FileVersion, and numeric-only InformationalVersion. This ensures more reliable version detection across different project styles. (Private/Get-CurrentVersionFromCsProj.ps1)
  • The version update function now modifies all relevant version tags (Version, VersionPrefix, PackageVersion, AssemblyVersion, FileVersion, InformationalVersion) when present, rather than just VersionPrefix. This provides more comprehensive version updates for SDK-style and legacy projects. (Private/Update-VersionInCsProj.ps1) [1] [2]
  • Documentation for Set-ProjectVersion and related functions is updated to clarify which tags are affected and how versioning is handled for .csproj files. (Docs/Set-ProjectVersion.md)

Documentation refactoring and parameter descriptions:

  • The documentation for Publish-GitHubReleaseAsset is refactored for clarity: redundant examples are removed, parameter descriptions are replaced with placeholders for future completion, and parameter documentation is reorganized for easier reading and maintenance. (Docs/Publish-GitHubReleaseAsset.md) [1] [2] [3] [4] [5] [6] [7] [8]

PowerShell assembly metadata extraction robustness:

  • The method for extracting cmdlet and alias information from PowerShell assemblies is improved to resolve type identity issues, handle assemblies that reference System.Management.Automation in different ways, and ensure unique results. This makes metadata extraction more reliable across various build and runtime scenarios. (Public/Get-PowerShellAssemblyMetaData.ps1)

Module manifest update:

  • The exported functions list in the PowerShell module manifest is updated to remove a duplicate and ensure only the intended functions are exported. (PSPublishModule.psd1)

… tidy `Publish-GitHubReleaseAsset` docs and exports

* `Get-PowerShellAssemblyMetadata`: load target assembly first and resolve `System.Management.Automation` inside the same MetadataLoadContext (by referenced name or fallback to host path) to avoid type identity issues.
* Add robust cmdlet detection (attribute FullName + fallback walking base types for `Cmdlet`/`PSCmdlet`), handle `GetTypes()` exceptions by falling back to `GetExportedTypes()`, extract aliases reliably, and return unique results.
* `Docs/Publish-GitHubReleaseAsset.md`: reorganize parameter sections, move/clean up examples, remove duplicated TagTemplate/ZipPath blocks and replace some descriptions with placeholders for later fill-in.
* `PSPublishModule.psd1`: remove `Convert-CommandsToList` from `FunctionsToExport`.
…, and `FileVersion` in .csproj

* Prefer `VersionPrefix` when reading current version; fall back to `AssemblyVersion` and `FileVersion`.
* Update `Update-VersionInCsProj.ps1` to replace `VersionPrefix`, `AssemblyVersion`, and `FileVersion` when present.
* Update `Set-ProjectVersion.md` to document that .csproj files have those elements updated.
…alVersion` in .csproj handling

* Read additional version tags (`<Version>`, `<PackageVersion>`, `<InformationalVersion>`) in `Get-CurrentVersionFromCsProj`
* Update `Update-VersionInCsProj` to replace and persist those tags when present
* Align documentation (`Set-ProjectVersion.md`) to list all supported .csproj version elements

This improves handling for SDK-style projects and pack scenarios by ensuring all common version properties are detected and updated.
@PrzemyslawKlys PrzemyslawKlys merged commit f63b3c3 into master Oct 28, 2025
0 of 3 checks passed
@PrzemyslawKlys PrzemyslawKlys deleted the SmallImprovements branch October 28, 2025 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants