Skip to main content

New-AdmfContextModule

SYNOPSIS

Create an ADMF Client PowerShell module.

SYNTAX

__AllParameterSets

New-AdmfContextModule [-Name] <Object> [-Repository] <string> [-Path] <string>
[-ModuleName] <string> [[-ModuleOption] <string[]>] [[-AliasPrefix] <string>]
[[-ModuleVersion] <version>] [[-Credential] <pscredential>] [[-ModuleCode] <scriptblock>] [-GetV3]
[<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

-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: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 5
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Credential

Credentials to use for accessing the powershell repository.

Type: System.Management.Automation.PSCredential
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 7
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-GetV3

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

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ModuleCode

Additional code to iunclude in the module generated

Type: System.Management.Automation.ScriptBlock
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 8
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ModuleName

Name of the module to generate.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 3
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-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: System.String[]
DefaultValue: Confirm
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 4
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ModuleVersion

The version of the module to generate. Defaults to 1.0.0

Type: System.Version
DefaultValue: 1.0.0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 6
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-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: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Path

Path where to write the finished module to.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Repository

Name of the repository to download from.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

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