Commands / Install-sqmAdModule
Install-sqmAdModule
ConfigurationsqmSQLTool v1.8.2+ · Module Setup⚠ Admin Required  Fallback Chain
Ensures that the ActiveDirectory PowerShell module (RSAT) is installed using a robust four-tier fallback chain: (1) Windows Capability (Win10+/Server2019+), (2) Windows Feature (ServerManager), (3) DISM, (4) PSGallery. Automatically handles NuGet provider updates and imports the module after successful installation.

Parameters

ParameterTypeRequiredDefaultNotes
-SkipIfPresentswitchSwitch$trueSkip installation if module already present.
-ContinueOnErrorswitchSwitch$falseReturn $false instead of throwing on failure.
-EnableExceptionswitchSwitch$falseThrow exceptions immediately (overrides -ContinueOnError).
-WhatIf / -ConfirmswitchOptionalShouldProcess supported for preview.

Execution Flow

START Administrator rights? NO throw: admin required YES Module present? YES return $true (skip install) NO Method 1: Add-WindowsCapability (Win10+/Server2019+) Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0 Success? YES Import & return $true NO Method 2-4 Fallback Chain 2: Install-WindowsFeature RSAT-AD-PowerShell (ServerManager) 3: DISM /Add-Capability (older systems) 4: Install-Module ActiveDirectory (PSGallery w/ NuGet provider) Each method only attempted if previous failed Any method succeeded? NO throw / return $false YES Import-Module ActiveDirectory into current session Verify import success Return $true/$false

Examples

Install if missing
Install-sqmAdModule
Force reinstall even if present
Install-sqmAdModule -SkipIfPresent:$false