Active Directory Management Framework

Configuration driven Active Directory management.

New-AdmfContextModule

SYNOPSIS

Create an ADMF Client PowerShell module.

SYNTAX

New-AdmfContextModule [-Name] <Object> [-Repository] <String> [-Path] <String> [-ModuleName] <String>
 [[-ModuleOption] <String[]>] [[-AliasPrefix] <String>] [[-ModuleVersion] <Version>]
 [[-Credential] <PSCredential>] [[-ModuleCode] <ScriptBlock>] [-GetV3] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

DESCRIPTION

Create an ADMF Client PowerShell module. Specify which contexts to use from a repository to which they have previously been published.

It will then dynamically create a PowerShell module containing all contexts and their dependencies and publish them under its own Context store once imported.

EXAMPLES

EXAMPLE 1

New-AdmfContextModule -Name Default -Repository Contoso -Path . -ModuleName Whatever -ModuleOption Confirm -AliasPrefix WE

Retrieves the “Default” context from the “Contoso” repository. It will then wrap it into a module named “Whatever”, injecting a requirement to confirm all changes and include aliases for the common ADMF commands with the WE prefix (e.g. Test-WEDomain)

PARAMETERS

-Name

Name of the contexts to include. Supports plain “Name” or the PowerShell module notation. Examples: “Default” @{ ModuleName = ‘SecBaseline’ } @{ ModuleName = ‘SecBaseline’; ModuleVersion = ‘2.0.0’ } @{ ModuleName = ‘SecBaseline’; RequiredVersion = ‘2.3.1’ }

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Repository

Name of the repository to download from.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Path

Path where to write the finished module to.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ModuleName

Name of the module to generate.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ModuleOption

Additional options to include in the module code when generating the module. Confirm: Injects all ADMF component modules with the requirement to confirm all changes.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: Confirm
Accept pipeline input: False
Accept wildcard characters: False

-AliasPrefix

Create aliases for the common ADMF commands. This simplifies guiding users into loading the module containing their configuration settings. Rather than having them run Test-ADMFDomain, you could have them run Test-ConDomain, which would then implicitly load the generated module and make the contexts available, without having to first manually import the module generated.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ModuleVersion

The version of the module to generate. Defaults to 1.0.0

Type: Version
Parameter Sets: (All)
Aliases:

Required: False
Position: 7
Default value: 1.0.0
Accept pipeline input: False
Accept wildcard characters: False

-Credential

Credentials to use for accessing the powershell repository.

Type: PSCredential
Parameter Sets: (All)
Aliases:

Required: False
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ModuleCode

Additional code to iunclude in the module generated

Type: ScriptBlock
Parameter Sets: (All)
Aliases:

Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-GetV3

Use PowerShellGet V3 or later. Defaults to the configuration setting of ADMF.PowerShellGet.UseV3.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES