Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows Powershell DSC挂起_Windows_Powershell_Scripting - Fatal编程技术网

Windows Powershell DSC挂起

Windows Powershell DSC挂起,windows,powershell,scripting,Windows,Powershell,Scripting,所以我的问题是,我试图使用PS Dsc安装一些基本的软件包,但是每当我尝试运行我的脚本时,它看起来好像启动了,但从未完成。我尝试按照建议传递-Force参数,但似乎这只是堆叠操作,而这些过程一直被卡住 这是我的剧本 Configuration WebServer { # Import the module that contains the resources we're using. Import-DscResource -ModuleName PsDesiredStateConfigur

所以我的问题是,我试图使用PS Dsc安装一些基本的软件包,但是每当我尝试运行我的脚本时,它看起来好像启动了,但从未完成。我尝试按照建议传递
-Force
参数,但似乎这只是堆叠操作,而这些过程一直被卡住

这是我的剧本

Configuration WebServer {

# Import the module that contains the resources we're using.
 Import-DscResource -ModuleName PsDesiredStateConfiguration

 Node "localhost" {

    Package InstallAspNetWebPages2
    {
        Ensure = "Present"
        Path = 
"C:\Users\jryter\Documents\WebServerInstalls\AspNetWebPages2Setup.exe"
        Name = "Microsoft ASP.NET Web Pages 2 Runtime"
        ProductID = "EA63C5C1-EBBC-477C-9CC7-41454DDFAFF2"
    }

 }

}


WebServer -OutputPath "C:\DscConfiguration"

Start-DscConfiguration -Wait -Force -verbose -Path "C:\DscConfiguration"
当前LCM状态为正在执行一致性检查。 我尝试了以下链接-->

但是没有用

是否有一些基本配置我没有正确运行这些东西?有人有这个问题吗


DSC可能启动了exe,它只是在那里等待您的输入。您需要为静默安装添加参数

Package InstallAspNetWebPages2
{
    Ensure = "Present"
    Path = "path\file.exe"
    Name = "Microsoft ASP.NET Web Pages 2 Runtime"
    ProductID = "EA63C5C1-EBBC-477C-9CC7-41454DDFAFF2"
    Arguments   = "/silent" or "/quiet"
}

我不知道这个的正确论点是什么,exe给了这个机会,但没有看到任何结果。我尝试传递-->
Arguments=“/I/q/norestart”
,但它看起来没有做任何事情。我似乎也找不到任何有关powershell包资源参数的正式文档。与powershell dsc无关。查找如何以静默方式安装此特定文件并将这些参数传递给dsc。因此,在本例中,静默安装的参数为
/q
。但是,由于我的DSC状态已经“挂起”,我需要清除DSC中的所有内容,执行以下操作
#删除所有mof文件(挂起、当前、备份、MetaConfig.mof、缓存等)rm C:\windows\system32\Configuration\*.mof*#杀死LCM/DSC进程gps wmi*|?{$\ modules.ModuleName-like“*DSC*”}停止进程-force
。不过,我会给你正确的答案,因为由于沉默的争论,我实际上能够在我终止进程后安装。