代码之家  ›  专栏  ›  技术社区  ›  Brettski

PowerShell DSC,将MOF输出到不同文件夹

  •  4
  • Brettski  · 技术社区  · 8 年前

    给定此简单配置文件:

    Configuration MyDscConfiguration {
    
        Node "TEST-PC1" {
            WindowsFeature MyFeatureInstance {
                Ensure = "Present"
                Name =  "RSAT"
            }
            WindowsFeature My2ndFeatureInstance {
                Ensure = "Present"
                Name = "Bitlocker"
            }
        }
    }
    MyDscConfiguration
    

    运行时,为节点“test-pc1”生成的mof文件将放在名为, MyDscConfiguration .

    我正在寻找将MOF输出到自定义目录位置的方法,例如 mofs\MyDscConfiguration\

    这有可能吗?

    1 回复  |  直到 8 年前
        1
  •  6
  •   briantist    8 年前

    是的,您的配置有 -OutputPath 你能给它的参数。

    配置的功能和工作方式基本相同。

    你甚至可以用 Get-Help MyDscConfiguration 查看它的所有参数(您可以定义自己的 param() 也用它来阻塞,就像对函数一样)。

    桌棋类游戏 完成也可以,所以这是一个快速发现参数的方法。

    推荐文章