cEPRSInstallBinaries.psm1
enum Ensure { Present Absent } [DSCResource()] class EPRSInstallBinaries { [DSCProperty(Key)] [String] $DLL_Installed [DSCProperty(Key)] [String] $FrameworkPath [EPRSInstallBinaries] Get() { $config = @{ DLL_Installed = $this.DLL_Installed; 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 "Executinng Installutil - Start" & "$($this.FrameworkPath)\InstallUtil.exe" "$($this.DLL_Installed)" Write-Verbose "Executinng Installutil - End" } Catch [system.exception] { write-Verbose $_.exception.message -Verbose } } } |