Skip to content

Cleanup and modernize codebase with PS7/C# latest features - #7

Merged
marcelloformica merged 1 commit into
mainfrom
dev
Mar 23, 2026
Merged

marcelloformica merged 1 commit into
mainfrom
dev

Conversation

@marcelloformica

Copy link
Copy Markdown
Contributor

Summary

Cleanup, modernize, and document both PowerShell and C# codebases with latest language features and best practices.

Changes

PowerShell (get-availability.ps1)

  • Added doc-comments to all helper functions and critical code sections
  • Added descriptive section headers for batch config, endpoint validation, batch metrics, per-resource metrics, investigation, and output
  • Replaced \if/else\ with PS7 ternary operators in multiple locations
  • Fixed batch-implies semantics: use \System.Management.Automation.PSBoundParametersDictionary.ContainsKey('BatchSize')\ instead of \ -ne 10\
  • Added classification precedence documentation to \Invoke-SuspectGapInvestigation\
  • Added inline comments to investigation helpers

C# (.NET 10)

  • Replaced \Math.Max/Min\ with \Math.Clamp\ in Program.cs
  • Consolidated triple \TryGetValue\ dictionary lookups into a single block
  • Changed \string[]\ to \ReadOnlySpan\ for timestamp formats (stack allocation) in ActivityLogService.cs
  • Added <summary>\ doc-comments to helper methods across services
  • Added BatchMetricsService.cs to source control

Documentation

  • Updated README with batch mode parameters and usage examples for both C# and PowerShell
  • Added batch API mode bullet to Architecture notes

- Add doc-comments to helpers, services, and critical code sections
- Use PS7 ternary operators and PSBoundParameters for batch detection
- Use Math.Clamp, ReadOnlySpan, and consolidated TryGetValue in C#
- Add descriptive section headers and classification docs
- Update README with batch mode parameters and usage examples
- Add BatchMetricsService.cs to source control
@marcelloformica
marcelloformica merged commit c5ac4ec into main Mar 23, 2026
1 check passed
@marcelloformica
marcelloformica deleted the dev branch March 23, 2026 17:06
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.

1 participant