Created
March 24, 2021 19:59
-
-
Save SteveL-MSFT/399cd7a96d2a431b0a758e937d711318 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DscResource()] | |
class FileContentResource { | |
[DscProperty(Key)] | |
[string] $filePath | |
[DscProperty(Mandatory)] | |
[string] $content | |
[FileContentResource] Get() | |
{ | |
$this.content = Get-Content -Path $this.filePath | |
return $this | |
} | |
[void] Set() | |
{ | |
Set-Content -Path $this.filePath -Value $this.Content | |
} | |
[bool] Test() | |
{ | |
return (Get-Content -Path $this.filePath) -eq $this.content | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment