期望的状态配置详细记录

问题描述 投票:2回答:3

在尝试使用所需状态配置调试问题时,我发现以下命令非常有用;

start-dscconfiguration -wait -verbose -useexisting 

这将(显然)允许查看所有详细日志。

问题是,如果服务器需要重新启动作为配置的一部分,或者 - 更重要的是 - 它正常运行(例如,作为拉配置的一部分是非交互式的),查看这些日志并不容易。

有没有办法将/ exact / same输出记录到特定位置?

我在其中一个答案中建议的C:\Windows\system32\configuration\configurationstatus文件夹中没有任何.json文件?

dsc
3个回答
1
投票

在元配置中将RebootNodeIfNeeded设置为false:

[DscLocalConfigurationManager()]
configuration Settings
{
    Settings
    {
        ActionAfterReboot  = 'StopConfiguration'
        RebootNodeIfNeeded = $false
    }
}

并再次运行现有配置:

Start-DscConfiguration -Wait -UseExisting -Verbose

(为后代添加此内容,因为其他答案仅包含链接。)来源:http://nanalakshmanan.com/blog/DSC-get-job-details-post-reboot/


0
投票

您可以按照此博客中列出的步骤获取重启http://nanalakshmanan.com/blog/DSC-get-job-details-post-reboot/后的结果


-1
投票

您还可以按照此博客http://nanalakshmanan.com/blog/Historical-Job-Logs/中的说明查看历史作业日志

© www.soinside.com 2019 - 2024. All rights reserved.