AzStackHci.DiagnosticSettings.psm1

##########################################################################################################
<#
.SYNOPSIS
    Author: Neil Bird, MSFT
    Version: 0.6.2
    Created: July 16th 2024
    Updated: March 13th 2026
 
.DESCRIPTION
 
    This module includes functions that automate configuring diagnostics settings and/or validation for Azure Local instances.
    Examples are functions that help configure a static page file (if the node has low disk space) and kernel memory dump settings using a dedicated dump file.
    A function to test connectivity to Azure endpoints, including TCP port tests, Layer 7 HTTP/S tests, and to help verify SSL certificates used by remote endpoints
    are trusted. The module also includes a function to send cluster performance history logs to Microsoft, to help with troubleshooting performance issues.
    And a function to export OS configuration settings to text files and upload them to Microsoft for support purposes.
 
    # Memory Dump Settings references:
        # https://blogs.msdn.microsoft.com/clustering/2015/05/18/windows-server-2016-failover-cluster-troubleshooting-enhancements-active-dump/
        # https://blogs.msdn.microsoft.com/clustering/2016/03/02/troubleshooting-hangs-using-live-dump/
        # https://blogs.msdn.microsoft.com/ntdebugging/2010/04/02/how-to-use-the-dedicateddumpfile-registry-value-to-overcome-space-limitations-on-the-system-drive-when-capturing-a-system-memory-dump/
        # https://support.microsoft.com/en-us/help/949052/kernel-memory-dump-files-may-not-be-generated-on-windows-server-2008-b
        # https://learn.microsoft.com/en-us/windows/win32/wer/wer-settings
        # https://learn.microsoft.com/en-us/troubleshoot/windows-server/performance/memory-dump-file-options
        # https://learn.microsoft.com/en-us/windows-server/administration/server-core/server-core-memory-dump
        # https://learn.microsoft.com/en-us/azure/azure-local/concepts/firewall-requirements
 
    # Connectivity Test references:
        # https://learn.microsoft.com/en-us/azure/azure-local/concepts/firewall-requirements
        # https://learn.microsoft.com/en-us/azure/azure-local/deploy/deployment-azure-arc-gateway-overview
        # https://learn.microsoft.com/en-us/azure/azure-local/deploy/deployment-with-azure-arc-gateway
 
.EXAMPLE
 
    This module contains the following exported functions:
 
        1. Get-AzStackHciMemoryDumpSettings
        2. Set-AzStackHciMemoryDumpSettings
        3. Restore-AzStackHciMemoryDumpSettings
        4. Get-AzStackHciPageFileSettings
        5. Restore-AzStackHciPageFileSettings
        6. Set-AzStackHciPageFileMinimumSettings
        7. Set-AzStackHciUserModeCrashDumpSettings
        8. Test-AzStackHciSSLInspection
        9. Send-ClusterPerformanceHistory
        10. Test-AzureLocalConnectivity
        11. Test-Layer7Connectivity
        12. Test-TCPConnectivity
        13. Get-AzStackHciOsConfigSettings
        14. Test-ArcMachinePrivateLinkScopeEnabled
 
.NOTES
    THIS CODE-SAMPLE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
    FITNESS FOR A PARTICULAR PURPOSE.
 
    This sample is not supported under any Microsoft standard support program or service.
    The script is provided AS IS without warranty of any kind. Microsoft further disclaims all
    implied warranties including, without limitation, any implied warranties of merchantability
    or of fitness for a particular purpose. The entire risk arising out of the use or performance
    of the sample and documentation remains with you. In no event shall Microsoft, its authors,
    or anyone else involved in the creation, production, or delivery of the script be liable for
    any damages whatsoever (including, without limitation, damages for loss of business profits,
    business interruption, loss of business information, or other pecuniary loss) arising out of
    the use of or inability to use the sample or documentation, even if Microsoft has been advised
    of the possibility of such damages, rising out of the use of or inability to use the sample script,
    even if Microsoft has been advised of the possibility of such damages.
 
#>

##########################################################################################################

#Requires -Version 5.0


# AzStackHci.DiagnosticSettings root module
# All functions are loaded via NestedModules in the .psd1 manifest.
# Do not add a Get-ChildItem/foreach loader here - files must be
# explicitly listed in the manifest for security.