PSMaintenanceMode.psm1
$Modules = @( Get-ChildItem -Path $PSScriptRoot\Modules\*.ps1 -ErrorAction SilentlyContinue ) $Helpers = @( Get-ChildItem -Path $PSScriptRoot\Helper\*.ps1 -ErrorAction SilentlyContinue ) Foreach($Module in $Modules) { Try { . $Module.fullname } Catch { Write-Error -Message "Failed to import function $($Module.fullname): $_" } } Foreach($Helper in $Helpers) { Try { . $Helper.fullname } Catch { Write-Error -Message "Failed to import function $($Helper.fullname): $_" } } Export-ModuleMember -Function Start-SCOMAgentMaintenanceMode Export-ModuleMember -Function Reset-SCOMAgentMaintenanceMode |