カスタムDSCリソースの作成に頼らずに、DSCリソース内にいくつかのロジックを持たせる最良の方法は何ですか?例は次のとおりです。 内蔵のDSCリソースFile
にパラメータcontent
を提供する必要があります。私はその値を返すためにConfiguration内にFunctionを置くことができず、ロジックをContent
タグの中に入れることはできないようです。このような状況には、どのようなアプローチが可能でしょうか。DSCリソース内で複雑なロジックを使用することは可能ですか?
`` ` $ filePathに=参加-パス-Path "$($のENV:はProgramData)" -ChildPath "ドッキングウィンドウ\ CONFIG \ daemon.json"
$filePath = Join-path -Path `"$($env:programdata)`" -ChildPath "docker\config\daemon.json`"
if (test-Path ($filePath))
{) { $jsonConfig = get-content $filePath | convertfrom-json
$jsonConfig.graph = $graphLocation
$jsonConfig | convertto-json
}
else { @{ graphLocation = "$graphLocation"} | convertto-json
}
` ``