When contributing to this project, ensure you:
- Review existing functions already available and reuse where possible.
- Return native .NET objects whenever possible.
- Rarely should you return from a function with format-table, format-list, etc.. If they do, they should use the PowerShell verb
Show. - Environments that this module run on may be in a broken or inconcistent state, so defensive coding techniques should be leveraged.
- Use PowerShell Approved Verbs when creating functions.
- Provide detailed function synopsis, description, parameters and examples. The build pipeline leverages platyPS to auto-generate documentation for the exported functions and publishes to the project wiki.
When creating functions:
- Functions should be placed under the respective module that they execute under based on the role.
- If your function should be exported and available after module import, be sure to add your function to the export list in
src\SdnDiagnostics.psd1underFunctionsToExport.
- To generate a local build of the module, run
.\build.ps1which will generate an SdnDiagnostics module package to~\out\build\SdnDiagnostics. - Copy the module to
C:\Program Files\WindowsPowerShell\Modules.- Remove any existing modules if they are present.
- Folder path structure should resemble
\SdnDiagnostics\{version}
- Import the module using
Import-Module -Name SdnDiagnostics -Force.- If you have already imported the
SdnDiagnosticsmodule and need to re-import, you first mustRemove-Module -Name SdnDiagnosticsand then perform theImport-Moduleoperation. This will ensure that the nested modules, classes and enums are loaded correctly.
- If you have already imported the
- Install the modules to the SDN nodes in the dataplane.
$environmentDetails = Get-SdnInfrastructureInfo -NetworkController 'NC01'
Install-SdnDiagnostics -ComputerName $environmentDetails.FabricNodes