带有数字签名模块的 PowerShell DSC Pull Server - ErrorDetail 是 PS缺失或其关联的 MOF 架构

带有数字签名模块的 PowerShell DSC Pull Server - ErrorDetail 是 PS缺失或其关联的 MOF 架构

我已经配置了一个测试 DSC 拉取服务器,并尝试使用数字签名的xPowerShellExecutionPolicy文件,但我不断收到一条错误消息,指出 MOF 架构文件无效或丢失。

代码签名证书来自受信任的商业 CA。两台服务器都是 2012 R2。

这是显示签名信息的图像。此脚本位于

C:\Program Files\WindowsPowerShell\modules\xPowerShellExecutionPolicy\DSCResources\xPowerShellExecutionPolicy

签名模块的属性对话框

以下是其他相关文件。如您所见,MOF 架构文件清晰可见。

相关 DSC 文件

这是我在目标服务器上看到的错误。

TimeCreated          LevelDisplayName Message                                                                                                                                                 
-----------          ---------------- -------                                                                                                                                                 
7/28/2015 1:44:43 PM Information      Job {53AD07E6-3550-11E5-80BE-A4BADB4CE593} :                                                                                                            
                                      Job runs under the following LCM setting.                                                                                                               
                                      ConfigurationMode: ApplyAndAutoCorrect                                                                                                                  
                                      ConfigurationModeFrequencyMins: 30                                                                                                                      
                                      RefreshMode: Pull                                                                                                                                       
                                      RefreshFrequencyMins: 30                                                                                                                                
                                      RebootNodeIfNeeded: NONE                                                                                                                                
                                      DebugMode: False                                                                                                                                        
7/28/2015 1:44:43 PM Information      Job {53AD07E6-3550-11E5-80BE-A4BADB4CE593} :                                                                                                            
                                      Running consistency engine.                                                                                                                             
7/28/2015 1:44:43 PM Information      Job {53AD07E6-3550-11E5-80BE-A4BADB4CE593} :                                                                                                            
                                      Configuration is sent from computer NULL by user sid S-1-5-21-836088835-2467000696-1087451681-4146.                                                     
7/28/2015 1:41:10 PM Error            Job {D4A0B0DF-354F-11E5-80BE-A4BADB4CE593} :                                                                                                            
                                      This event indicates that failure happens when LCM is trying to get the configuration from pull server using download manager WebDownloadManager.       
                                      ErrorId is 0x1. ErrorDetail is The PS module C:\Program                                                                                                 
                                      Files\WindowsPowerShell\Modules\xPowerShellExecutionPolicy\DscResources\xPowerShellExecutionPolicy is either missing or its associated MOF schema       
                                      C:\Program Files\WindowsPowerShell\Modules\xPowerShellExecutionPolicy\DscResources\xPowerShellExecutionPolicy\xPowerShellExecutionPolicy.schema.mof is  
                                      missing or invalid.                                                                                                                                     
7/28/2015 1:41:10 PM Information      Job {D4A0B0DF-354F-11E5-80BE-A4BADB4CE593} :                                                                                                            
                                      The content validation for module xPowerShellExecutionPolicy completed with status code 6.                                                              
7/28/2015 1:41:10 PM Information      Job {D4A0B0DF-354F-11E5-80BE-A4BADB4CE593} :                                                                                                            
                                      Message File C:\Program                                                                                                                                 
                                      Files\WindowsPowerShell\Modules\xPowerShellExecutionPolicy\DscResources\xPowerShellExecutionPolicy\xPowerShellExecutionPolicy.psm1 cannot be loaded.    
                                      The file C:\Program Files\WindowsPowerShell\Modules\xPowerShellExecutionPolicy\DscResources\xPowerShellExecutionPolicy\xPowerShellExecutionPolicy.psm1  
                                      is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see 
                                      about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.                                                                              
                                      HResult -2146233087                                                                                                                                     
                                      StackTrack    at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean      
                                      enumerate)                                                                                                                                              
                                         at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()                                                                               
                                         at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()                                                                           
7/28/2015 1:41:10 PM Information      Job {D4A0B0DF-354F-11E5-80BE-A4BADB4CE593} :                                                                                                            
                                      The checksum validation for module xPowerShellExecutionPolicy completed with status code 0.                                                             
7/28/2015 1:41:10 PM Information      Job {D4A0B0DF-354F-11E5-80BE-A4BADB4CE593} :                                                                                                            
                                      The modules (xPowerShellExecutionPolicy,1.0.0) were downloaded to the location C:\Windows\TEMP\\635736876701282694.                                     
7/28/2015 1:41:10 PM Information      Job {D4A0B0DF-354F-11E5-80BE-A4BADB4CE593} :                                                                                                            
                                      WebDownloadManager Get-DscModule command, module xPowerShellExecutionPolicy, File save result:                                                          
                                      C:\Windows\TEMP\635736876701282694\xPowerShellExecutionPolicy_1.0.0.zip.checksum.                                                                       
7/28/2015 1:41:10 PM Information      Job {D4A0B0DF-354F-11E5-80BE-A4BADB4CE593} :                                                                                                            
                                      WebDownloadManager Get-DscModule command, module xPowerShellExecutionPolicy, File save result:                                                          
                                      C:\Windows\TEMP\635736876701282694\xPowerShellExecutionPolicy_1.0.0.zip.   

答案1

我最终通过 Google 搜索获得了有用的信息。

这都是因为没有安装KB2883200

参考:

PowerShell 提供程序 MSFT_RoleResource 不包含相应的 MOF 文件

相关内容