cEPRSInstallDotnetFramework.psm1
enum Ensure { Present Absent } [DSCResource()] class cEPRSInstallDotnetFramework { [DSCProperty(Key)] [String] $FrameworkPath [cEPRSInstallDotNetFramework] Get() { $config = @{ FrameworkPath = $this.FrameworkPath; } return $config } [Bool] Test() { if(!(Test-Path -Path "$($this.FrameworkPath)" )) { Write-Warning "$($this.FrameworkPath) does not exist" return $true } else { return $false } } [void] Set() { try { Write-Verbose "Installing .NetFramework - Start" Install-WindowsFeature Net-Framework-Core -source "$($this.FrameworkPath)" Write-Verbose "Installing .NetFramework - End" } Catch [system.exception] { write-Verbose $_.exception.message -Verbose } } } |