mkht / dscr_filecontent Goto Github PK
View Code? Open in Web Editor NEWPowerShell DSC Resource to create TEXT / INI / JSON files.
License: MIT License
PowerShell DSC Resource to create TEXT / INI / JSON files.
License: MIT License
$output = 'C:\DSCMOF'
@"
{
"Key1": true
}
"@ | Out-File -FilePath 'C:\Test.json'
Configuration JsonTest
{
Import-DscResource -ModuleName DSCR_FileContent
Node localhost
{
JsonFile Case1 {
Path = 'C:\Test.json'
Key = 'Key1/Sub'
Value = 'false'
}
}
}
JsonTest -OutputPath $output
Start-DscConfiguration -Path $output -Wait
{
"Key1": {
"Sub": false
}
}
[System.Boolean] に 'ContainsKey' という名前のメソッドが含まれないため、メソッドの呼び出しに失敗しました。
+ CategoryInfo : InvalidOperation: (:) []、CimException
+ FullyQualifiedErrorId : MethodNotFound
+ PSComputerName : localhost
Test-TargetResource 機能の実行中に PowerShell DSC リソース [JsonFile]Case1 (SourceInfo '::11::9::JsonFi
le') が 1 つ以上の終了しないエラーをスローしました。これらのエラーは、Microsoft-Windows-DSC/Operational という名前の ETW チャネルに記録さ
れます。詳細については、このチャネルを参照してください。
+ CategoryInfo : InvalidOperation: (:) []、CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost
SendConfigurationApply 関数が失敗しました。
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [],
CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : localhost
JsonFile Case1 {
Path = 'C:\Test.json'
Key = 'Key1'
Value = 'null'
}
{
"Key1": null
}
{
"Key1": "null"
}
JsonFile Case1 {
Path = 'C:\Test.json'
Key = 'Key1'
Value = 'true'
}
JsonFile Case2 {
Path = 'C:\Test.json'
Key = 'Key2'
Value = 'True'
}
JsonFile Case3 {
Path = 'C:\Test.json'
Key = 'Key3'
Value = '"true"'
}
JsonFile Case4 {
Path = 'C:\Test.json'
Key = 'Key4'
Value = $true
}
JsonFile Case5 {
Path = 'C:\Test.json'
Key = 'Key4'
Value = '[true]'
}
{
"Key1": true,
"Key2": true,
"Key3": "true",
"Key4": true
}
{
"Key1": true,
"Key2": "True",
"Key3": "true",
"Key4": "True"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.