PowerShell / WindowsCompatibility

Module that allows Windows PowerShell Modules to be used from PSCore6
Other
137 stars 33 forks source link

ADDSDeployment module does not load - cannot create DCs #74

Open doctordns opened 5 years ago

doctordns commented 5 years ago

Using WIndows Server 2019 1903 and PowerShell Core 6.2.1

Cannot load the ADDSDeploymeht module which means I cannot use the Install-ADDSForest and other cmdlets from that module.

If I try to import the module, I see this:

PS C:\Foo> Import-Module ADDSDeployment -verbose
VERBOSE: Loading module from path 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ADDSDeployment\ADDSDeployment.psd1'.
VERBOSE: Loading 'Assembly' from path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.DirectoryServices.Deployment\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.DirectoryServices.Deployment.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.DirectoryServices.Deployment\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.DirectoryServices.Deployment.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.ADRoles.Deployment.Common\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.ADRoles.Deployment.Common.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.ADRoles.Deployment.Common\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.ADRoles.Deployment.Common.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.DirectoryServices.Deployment.Types\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.DirectoryServices.Deployment.Types.dll'.0__31bf3856ad364e35\Microsoft.DirectoryServices.Deployment.Types.dll'.                                                                     0.0__31bf3856ad364e35\Microsoft.DirectoryServices.Deployment.Types.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.DirectoryServices.Deployment.Types\v4.0_10.0.erShell edition 'Core'. Its supported editions are 'Desktop'. Use 'Import-Modul0.0__31bf3856ad364e35\Microsoft.DirectoryServices.Deployment.Types.dll'.
Import-Module : Module 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ADDSDeployment\ADDSDeployment.psd1' does not support current PowerShell edition 'Core'. Its supported editions are 'Desktop'. Use 'Import-Module -SkipEditionCheck' to ignore the compatibility of this module.
At line:1 char:1                                                                                                                           tion
+ Import-Module ADDSDeployment -verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ResourceUnavailable: (C:\Windows\system32\u2026ADDSDeployment.psd1:String) [Import-Module], InvalidOperationExcep

If I use the -SkipEditionCheck, I See this:

PS C:\Foo> Import-Module ADDSDeployment -verbose -SkipEditionCheck
VERBOSE: Loading module from path 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ADDSDeployment\ADDSDeployment.psd1'.
VERBOSE: Loading 'Assembly' from path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.DirectoryServices.Deployment\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.DirectoryServices.Deployment.dll'.VERBOSE: Loading 'Executable' from path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.DirectoryServices.Deployment\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.DirectoryServices.Deployment.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.ADRoles.Deployment.Common\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.ADRoles.Deployment.Common.dll'.VERBOSE: Loading 'Executable' from path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.ADRoles.Deployment.Common\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.ADRoles.Deployment.Common.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.DirectoryServices.Deployment.Types\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.DirectoryServices.Deployment.Types.dll'.VERBOSE: Loading 'Executable' from path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.DirectoryServices.Deployment.Types\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.DirectoryServices.Deployment.Types.dll'.
Import-Module : Could not load type 'System.Management.Automation.CustomPSSnapIn' from assembly 'System.Management.Automation, Version=6.2.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.At line:1 char:1
+ Import-Module ADDSDeployment -verbose -SkipEditionCheck+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Import-Module], TypeLoadException+ FullyQualifiedErrorId : System.TypeLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand

Can we get a fix for this?

doctordns commented 4 years ago

A work around is to use the WIndowsCompatibility module, but this module should be ported to .NET Core.