Fix Write-Host/ConvertTo-Json pipeline bug, add Get-NFSDatastoreNConnectValue function and test coverage#405
Draft
Copilot wants to merge 2 commits into
Draft
Fix Write-Host/ConvertTo-Json pipeline bug, add Get-NFSDatastoreNConnectValue function and test coverage#405Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
…t fix, export in psd1, add tests with AVSAttribute and happy path coverage
Copilot
AI
changed the title
[WIP] Fix code according to review comments
Fix Write-Host/ConvertTo-Json pipeline bug, add Get-NFSDatastoreNConnectValue function and test coverage
May 30, 2026
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.
Addresses review feedback from PR #390: fixes a broken
Write-Hostpipeline pattern, adds theGet-NFSDatastoreNConnectValueAVS Run Command function, and introduces comprehensive Pester test coverage.The changes in this PR are as follows:
Write-Host $NamedOutputs | ConvertTo-Jsonnever emitted JSON becauseWrite-Hostdoesn't write to the pipeline. Fixed toWrite-Host ($NamedOutputs | ConvertTo-Json -Depth 10).Get-NFSDatastoreNConnectValueinMicrosoft.AVS.NFS.psm1— queries NFS nConnect (TCP connection count) for a given datastore across all connected hosts in a cluster; skips disconnected/maintenance hosts with a warning; sets$global:NamedOutputskeyed by host name.Get-NFSDatastoreNConnectValueadded toFunctionsToExportinMicrosoft.AVS.NFS.psd1.tests/Microsoft.AVS.NFS.Tests.ps1) — 26 Pester tests covering: module load/export verification, parameter validation, cluster/datastore/type/host error paths, disconnected-host handling, happy path (connected hosts populateNamedOutputs, disconnected hosts skipped,Get-EsxClicalled exactly twice), andAVSAttributeassertions (timeout,UpdatesSDDC,AutomationOnly) for all three exported functions.I have read the contributor guidelines and have completed the following:
AVSAttributeto newly exported functions.