| external help file | WindowsCompatibility-help.xml |
|---|---|
| Module Name | WindowsCompatibility |
| online version | |
| schema | 2.0.0 |
Import a compatibility module.
Import-WinModule [[-Name] <String[]>] [-Exclude <String[]>] [-ComputerName <String>]
[-ConfigurationName <String>] [-Prefix <String>] [-DisableNameChecking] [-NoClobber] [-Force]
[-Credential <PSCredential>] [-PassThru] [<CommonParameters>]
This command allows you to import proxy modules from a local or remote session. These proxy modules will allow you to invoke cmdlets that are not directly supported in this version of PowerShell.
There are commands in the Windows PowerShell core modules that don't exist natively in PowerShell Core. If these modules are imported, proxies will only be created for the missing commands. Commands that already exist in PowerShell Core will not be overridden. The modules subject to this restriction are:
- Microsoft.PowerShell.Management
- Microsoft.PowerShell.Utility
- Microsoft.PowerShell.Security
- Microsoft.PowerShell.Diagnostics
By default, when executing, the current compatibility session is used, or, in the case where there is no existing session, a new default session will be created. This behavior can be overridden using the additional parameters on the command.
Import-WinModule PnpDevice; Get-Command-Module PnpDeviceThis example imports the 'PnpDevice' module.
Import-WinModule Microsoft.PowerShell.Management; Get-CommandGet-EventLogThis example imports one of the core Windows PowerShell modules containing commands not natively available in PowerShell Core such as 'Get-EventLog'. Only commands not already present in PowerShell Core will be imported.
Import-WinModule PnpDevice -Verbose -ForceThis example forces a reload of the module 'PnpDevice' with verbose output turned on.
If you don't want to use the default compatibility session, use this parameter to specify the name of the computer on which to create the compatibility session. (Defaults to 'localhost')
Type: StringParameter Sets: (All)Aliases: cnRequired: FalsePosition: NamedDefault value: localhostAccept pipeline input: FalseAccept wildcard characters: FalseSpecifies the configuration to connect to when creating the compatibility session (Defaults to 'Microsoft.PowerShell')
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: Microsoft.PowerShellAccept pipeline input: FalseAccept wildcard characters: FalseThe credential to use when creating the compatibility session using the target machine/configuration
Type: PSCredentialParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseDisable warnings about non-standard verbs
Type: SwitchParameterParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: FalseAccept pipeline input: FalseAccept wildcard characters: FalseA list of wildcard patterns matching the names of modules that should not be imported.
Type: String[]Parameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseForce reloading the module
Type: SwitchParameterParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: FalseAccept pipeline input: FalseAccept wildcard characters: FalseSpecifies the name of the module to be imported. Wildcards can be used.
Type: String[]Parameter Sets: (All)Aliases:
Required: FalsePosition: 1Default value: *Accept pipeline input: FalseAccept wildcard characters: FalseDon't overwrite any existing function definitions.
Type: SwitchParameterParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: FalseAccept pipeline input: FalseAccept wildcard characters: FalseIf present, the ModuleInfo objects will be written to the output pipe as deserialized (PSObject) objects.
Type: SwitchParameterParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: FalseAccept pipeline input: FalseAccept wildcard characters: FalsePrefix to prepend to the imported command names
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).