Tags: microsoft/SdnDiagnostics
Tags
Fix remediation output for health tests for certs (#542) This pull request enhances the certificate validation logic in the SDN diagnostic health module by improving how certificate details are collected and reported in several health test functions. The main improvements include standardizing the way certificate properties are gathered and ensuring that results are consistently stored for reporting. **Certificate details collection and reporting:** * Refactored `Test-SdnCertificateExpired` and `Test-SdnCertificateMultiple` to accumulate certificate details into an array and assign them to `Properties` at the end of execution, ensuring consistent and structured reporting of affected certificates. [[1]](diffhunk://#diff-15898640fc68e07afa836ad8d93af4f22a4442978d9c233f39d48d44d85cfb60R1122) [[2]](diffhunk://#diff-15898640fc68e07afa836ad8d93af4f22a4442978d9c233f39d48d44d85cfb60R1141-R1143) [[3]](diffhunk://#diff-15898640fc68e07afa836ad8d93af4f22a4442978d9c233f39d48d44d85cfb60R1153-R1154) [[4]](diffhunk://#diff-15898640fc68e07afa836ad8d93af4f22a4442978d9c233f39d48d44d85cfb60R1168) [[5]](diffhunk://#diff-15898640fc68e07afa836ad8d93af4f22a4442978d9c233f39d48d44d85cfb60R1182-R1211) * In `Test-SdnNonSelfSignedCertificateInTrustedRootStore`, introduced a variable to collect certificate details and improved the process of adding certificate information to the result array. **Certificate selection logic:** * Enhanced logic in `Test-SdnCertificateMultiple` to prioritize certificates issued by `AzureStackCertificationAuthority` when determining which certificate to keep, and improved the remediation message formatting. # Change type - [x] Bug fix (non-breaking change) - [ ] Code style update (formatting, local variables) - [ ] New Feature (non-breaking change that adds new functionality without impacting existing) - [ ] Breaking change (fix or feature that may cause functionality impact) - [ ] Other # Checklist: - [x] My code follows the style and contribution guidelines of this project. - [x] I have tested and validated my code changes.
fix how to extract property from vfp port state (#541) This pull request updates the logic for parsing VFP port state properties in `Get-SdnVfpPortState` to better handle properties that are output without explicit key/value pairs, and adds support for the `SriovEnabled` property in the `VfpPortState` class. The main changes focus on improving how enabled features are detected and mapped to the state object. **Enhancements to VFP Port State Parsing:** * Updated the parsing logic in `Get-SdnVfpPortState` to handle lines that only contain a property name (without a value), assuming these properties are enabled by default when present in the output. This ensures properties like "SR-IOV Enabled" and various offload features are correctly set to `$true` when detected. * Moved the mapping of several port state and offload properties (such as "DTLS Offload Enabled", "GFT Offload Enabled", and various NVGRE/VXLAN offload features) from the key/value parsing block to the new single-property-line parsing block, improving robustness and accuracy. [[1]](diffhunk://#diff-11217f20b55d3b4ea34c8c217794c81d65acc4852dff9bf4295e5cc4d6dfaeedL2231-L2250) [[2]](diffhunk://#diff-11217f20b55d3b4ea34c8c217794c81d65acc4852dff9bf4295e5cc4d6dfaeedL2265-R2280) **VfpPortState Class Update:** * Added a new `[boolean]$SriovEnabled` property to the `VfpPortState` class to track the SR-IOV enablement state. # Change type - [x] Bug fix (non-breaking change) - [ ] Code style update (formatting, local variables) - [ ] New Feature (non-breaking change that adds new functionality without impacting existing) - [ ] Breaking change (fix or feature that may cause functionality impact) - [ ] Other # Checklist: - [x] My code follows the style and contribution guidelines of this project. - [x] I have tested and validated my code changes.
Onboard CoPilot instructions (#516) This pull request adds a comprehensive set of Copilot instructions for the `SdnDiagnostics` PowerShell module. The new documentation outlines project standards, coding conventions, module organization, and best practices to guide contributors and maintain code quality. Documentation and contributor guidance: * Introduced `.github/copilot-instructions.md` containing an overview of `SdnDiagnostics`, coding standards, function structure, error handling, logging, and tracing conventions. * Provided detailed module organization, specifying the purpose of each `.psm1` file for role-based functions. Development and operational practices: * Documented patterns for remote execution, REST API interactions, and data collection procedures, including credential handling and parameter usage. * Included security best practices, such as credential management and input validation. * Added example code snippets and common patterns to illustrate recommended approaches for contributors. --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: arudell <[email protected]>
Fix issue where ServiceStateTest failing for Mux (#484) # Description Summary of changes: - Fixed an issue where ServiceState test was failing for LoadBalancerMux role # Change type - [x] Bug fix (non-breaking change) - [ ] Code style update (formatting, local variables) - [ ] New Feature (non-breaking change that adds new functionality without impacting existing) - [ ] Breaking change (fix or feature that may cause functionality impact) - [ ] Other # Checklist: - [x] My code follows the style and contribution guidelines of this project. - [x] I have tested and validated my code changes.
Ignore errors if no IPv6 results returned (#480) # Description - `Get-Net*` cmdlets do not adhere to `$ErrorActionPreference` resulting in some cases, the data collection scripts to fail. Explicitly declared `-ErrorAction Ignore` on several cmdlets where error is returned if null results # Change type - [x] Bug fix (non-breaking change) - [ ] Code style update (formatting, local variables) - [ ] New Feature (non-breaking change that adds new functionality without impacting existing) - [ ] Breaking change (fix or feature that may cause functionality impact) - [ ] Other # Checklist: - [x] My code follows the style and contribution guidelines of this project. - [x] I have tested and validated my code changes.
set variable for process (#474) # Description Summary of changes: - set environment variable for process rather than user # Change type - [x] Bug fix (non-breaking change) - [ ] Code style update (formatting, local variables) - [ ] New Feature (non-breaking change that adds new functionality without impacting existing) - [ ] Breaking change (fix or feature that may cause functionality impact) - [ ] Other # Checklist: - [x] My code follows the style and contribution guidelines of this project. - [x] I have tested and validated my code changes.
Increase default logging level for Gateway tracing (#448) # Description This pull request updates configuration files for multiple modules in the SDN diagnostics system. The changes primarily involve adding descriptive comments for provider IDs and adjusting logging levels. These updates improve clarity and ensure consistent logging configurations across modules. ### Improvements to clarity: * [`src/modules/SdnDiag.Gateway.Config.psd1`](diffhunk://#diff-c0bdf20534e81b95c382f9ab06fd5f1d8653a5200d1123731c3941e8316b5fc3L34-R50): Added descriptive comments for provider IDs under the `IKE` and `Rasgateway` sections to specify their associated services (e.g., IKEEXT WPP / BFE, BGP, Microsoft-Windows-RRAS). * [`src/modules/SdnDiag.LoadBalancerMux.Config.psd1`](diffhunk://#diff-f5efbe475dce9955e5f42f22ce5f4eff21c9f347d002996d6146786921bbebedL30-R33): Added descriptive comments for provider IDs under the `SlbMux` section to specify their associated services (e.g., Microsoft-Windows-SlbMuxDriver, Microsoft-Windows-RasRoutingProtocols-BGP). * [`src/modules/SdnDiag.Server.Config.psd1`](diffhunk://#diff-22a4aebb1d422eb85344298764ac70d4b6b2d1608ebfd1a011f360a420eb6de4L42-R72): Added descriptive comments for provider IDs under multiple sections (`nchostagent`, `nvsp`, `slbhostagent`, `vfpext`) to specify their associated services (e.g., Microsoft.Windows.NetworkController.HostAgent.Service, Microsoft-Windows-Hyper-V-VfpExt). ### Logging configuration updates: * [`src/modules/SdnDiag.Gateway.Config.psd1`](diffhunk://#diff-c0bdf20534e81b95c382f9ab06fd5f1d8653a5200d1123731c3941e8316b5fc3L34-R50): Updated logging `Level` values from `4` to `255` for `IKE` and `Rasgateway` sections to ensure maximum verbosity. # Change type - [ ] Bug fix (non-breaking change) - [ ] Code style update (formatting, local variables) - [ ] New Feature (non-breaking change that adds new functionality without impacting existing) - [ ] Breaking change (fix or feature that may cause functionality impact) - [x] Other # Checklist: - [x] My code follows the style and contribution guidelines of this project. - [x] I have tested and validated my code changes.
gracefully handle if servermanager not present (#436) # Description This pull request updates the `Get-EnvironmentRole` function in `src/modules/SdnDiag.Utilities.psm1` to handle scenarios where the `Get-WindowsFeature` cmdlet may not be available. The change ensures that the function gracefully handles environments lacking this cmdlet by returning a default value. ### Key changes: * **Improved error handling for `Get-WindowsFeature`:** - Added a check using `Get-Command` to verify the existence of the `Get-WindowsFeature` cmdlet before attempting to use it. If the cmdlet does not exist, the function now returns the default array `@('Common')` without attempting further operations. # Change type - [x] Bug fix (non-breaking change) - [ ] Code style update (formatting, local variables) - [ ] New Feature (non-breaking change that adds new functionality without impacting existing) - [ ] Breaking change (fix or feature that may cause functionality impact) - [ ] Other # Checklist: - [x] My code follows the style and contribution guidelines of this project. - [x] I have tested and validated my code changes.
Misc Code Fixes 2025-03 6 (#412) # Description This pull request includes several changes to the `SdnDiagnostics` module to enhance data collection and improve code efficiency. The most important changes are related to adding execution timeouts, modifying the format of exported data, and optimizing the data collection process. ### Enhancements to data collection: * [`src/SdnDiagnostics.psm1`](diffhunk://#diff-490865628c61b2e97c50f45b37d7086647c70b2444cbfb9c60cc8c682801356eR976): Added `ExecutionTimeout` parameter with a value of 1800 seconds (30 minutes) to the `Start-SdnDataCollection` function to prevent long-running tasks from hanging indefinitely. [[1]](diffhunk://#diff-490865628c61b2e97c50f45b37d7086647c70b2444cbfb9c60cc8c682801356eR976) [[2]](diffhunk://#diff-490865628c61b2e97c50f45b37d7086647c70b2444cbfb9c60cc8c682801356eR1002) ### Improvements to data export: * [`src/modules/SdnDiag.Server.psm1`](diffhunk://#diff-11217f20b55d3b4ea34c8c217794c81d65acc4852dff9bf4295e5cc4d6dfaeedL709-R734): Changed the export format of `Get-VM` data from `Table` to `List` for better readability and consistency. * [`src/modules/SdnDiag.Server.psm1`](diffhunk://#diff-11217f20b55d3b4ea34c8c217794c81d65acc4852dff9bf4295e5cc4d6dfaeedL742-R752): Reorganized and optimized the export process for VM network adapters by removing unnecessary properties and reordering operations for efficiency. ### Code efficiency: * [`src/modules/SdnDiag.Utilities.psm1`](diffhunk://#diff-9e50bcf150b088e2c4df3d0768d8dcad4abf1338de3498749997682448a07bdcL1004-R1009): Simplified the `Export-ObjectToFile` function by removing wildcard usage in the switch statement and specifying exact type matches for better performance. # Change type - [x] Bug fix (non-breaking change) - [ ] Code style update (formatting, local variables) - [ ] New Feature (non-breaking change that adds new functionality without impacting existing) - [ ] Breaking change (fix or feature that may cause functionality impact) - [ ] Other # Checklist: - [x] My code follows the style and contribution guidelines of this project. - [x] I have tested and validated my code changes.
Change the order in which VMNetworkAdapter info is collected (#405) # Description This pull request includes changes to the `Get-CommonConfigState` and `Get-ServerConfigState` functions in the `SdnDiag.Common.psm1` and `SdnDiag.Server.psm1` files, respectively. The modifications aim to enhance the data collection process for network adapter and Hyper-V network details. Changes in `Get-CommonConfigState`: * Added commands to export VPort and VMQ Queue details. Changes in `Get-ServerConfigState`: * Reorganized and updated the gathering of Hyper-V network configuration details, including the reintroduction of commands to export VMNetworkAdapter and related details in a more efficient format. [[1]](diffhunk://#diff-11217f20b55d3b4ea34c8c217794c81d65acc4852dff9bf4295e5cc4d6dfaeedL670-R674) [[2]](diffhunk://#diff-11217f20b55d3b4ea34c8c217794c81d65acc4852dff9bf4295e5cc4d6dfaeedR704-R715) # Change type - [x] Bug fix (non-breaking change) - [ ] Code style update (formatting, local variables) - [ ] New Feature (non-breaking change that adds new functionality without impacting existing) - [ ] Breaking change (fix or feature that may cause functionality impact) - [ ] Other # Checklist: - [x] My code follows the style and contribution guidelines of this project. - [x] I have tested and validated my code changes.
PreviousNext