-
Notifications
You must be signed in to change notification settings - Fork 9
Assert Module
Assert if the specific module is available to be imported and optionally import the module.
Assert-Module [-ModuleName] <String> [-ImportModule] [-Force]
[<CommonParameters>]
Assert if the specific module is available to be imported and optionally import the module. If the module is not available an exception will be thrown.
See also Test-ModuleExist
.
Assert-Module -ModuleName 'DhcpServer'
This asserts that the module DhcpServer is available on the system. If it is not an exception will be thrown.
Assert-Module -ModuleName 'DhcpServer' -ImportModule
This asserts that the module DhcpServer is available on the system and imports it. If the module is not available an exception will be thrown.
Assert-Module -ModuleName 'DhcpServer' -ImportModule -Force
This asserts that the module DhcpServer is available on the system and it will be forcibly imported into the session (even if it was already in the session). If the module is not available an exception will be thrown.
Specifies to forcibly import the module even if it is already in the
session.
This parameter is ignored unless parameter ImportModule
is
also used.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Specifies to import the module if it is asserted.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Specifies the name of the module to assert.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
- Assert-BoundParameter
- Assert-ElevatedUser
- Assert-IPAddress
- Assert-Module
- Compare-DscParameterState
- Compare-ResourcePropertyState
- ConvertFrom-DscResourceInstance
- ConvertTo-CimInstance
- ConvertTo-HashTable
- Find-Certificate
- Get-ComputerName
- Get-DscProperty
- Get-EnvironmentVariable
- Get-LocalizedData
- Get-LocalizedDataForInvariantCulture
- Get-PSModulePath
- Get-TemporaryFolder
- Get-UserName
- New-ArgumentException
- New-ErrorRecord
- New-Exception
- New-InvalidDataException
- New-InvalidOperationException
- New-InvalidResultException
- New-NotImplementedException
- New-ObjectNotFoundException
- Remove-CommonParameter
- Set-DscMachineRebootRequired
- Set-PSModulePath
- Test-AccountRequirePassword
- Test-DscParameterState
- Test-DscProperty
- Test-IsNanoServer
- Test-IsNumericType
- Test-ModuleExist