2016-08-10 42 views
0

我已经安装了模块http://www.powershellgallery.com/packages/xActiveDirectory/,导入它,但是当我查看模块时,似乎没有任何内容,至少在所有cmdlet中都没有。以下是我所做的一份记录。显然我错过了一些东西,但不知道是什么。谁能帮忙?xActiveDirectory没有cmdlet。为什么?

PS C:\WINDOWS\system32> ipmo xActiveDirectory 
PS C:\WINDOWS\system32> Get-Module 

ModuleType Version Name        ExportedCommands 
---------- ------- ----        ---------------- 
Script  0.0  chocolateyProfile     {TabExpansion, Update-SessionEnvironment, refreshenv} 
Manifest 3.1.0.0 Microsoft.PowerShell.Management  {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Con... 
Manifest 3.1.0.0 Microsoft.PowerShell.Utility  {Add-Member, Add-Type, Clear-Variable, Compare-Object...} 
Binary  1.0.0.1 PackageManagement     {Find-Package, Find-PackageProvider, Get-Package, Get-Pack... 
Script  1.0.0.1 PowerShellGet      {Find-Command, Find-DscResource, Find-Module, Find-RoleCap... 
Script  1.2  PSReadline       {Get-PSReadlineKeyHandler, Get-PSReadlineOption, Remove-PS... 
Manifest 2.12.0.0 xActiveDirectory 


PS C:\WINDOWS\system32> Get-Module xActiveDirectory | fl 


Name    : xActiveDirectory 
Path    : C:\Program Files\WindowsPowerShell\Modules\xActiveDirectory\2.12.0.0\xActiveDirectory.psd1 
Description  : The xActiveDirectory module is originally part of the Windows PowerShell Desired State 
        Configuration (DSC) Resource Kit. This version has been modified for use in Azure. This module 
        contains the xADDomain, xADDomainController, xADUser, and xWaitForDomain resources. These DSC 
        Resources allow you to configure and manage Active Directory. 

        All of the resources in the DSC Resource Kit are provided AS IS, and are not supported through any 
        Microsoft standard support program or service. 
ModuleType  : Manifest 
Version   : 2.12.0.0 
NestedModules  : {} 
ExportedFunctions : 
ExportedCmdlets : 
ExportedVariables : 
ExportedAliases : 
+1

因为它是现有的整个原因是作为DSC资源。它必须有一个模块容器,但如果作者不希望它不需要导出命令。运行'Get-DscResource',这就是它输出的内容以及它存在的原因。 –

+0

明白了,谢谢@ Chris-dent – jamiet

回答

1

xActiveDirectory用于期望的状态配置。它包括DSC资源,而不是cmdlet。

尝试运行此:

Get-DscResource -Module xActiveDirectory 
+0

谢谢,这清除了这个谜。我现在需要去了解更多关于DSC和DSC资源的信息(我承认没有线索)。谢谢。 – jamiet

+0

@jamiet [这是一个很好的开始](https://msdn.microsoft.com/en-us/powershell/dsc/overview?f=255&MSPPError=-2147217396),但如果你想要一本书,我建议[学习PowerShell DSC](https://www.amazon.com/Learning-PowerShell-DSC-James-Pogran/dp/1783980702)。我对它进行了技术审查,我认为这是一本非常全面的书,对那些不熟悉配置管理的人有很好的介绍(通过我推荐的方式,我无法获得任何补偿)。 – briantist