dsccommunity / UpdateServicesDsc

This module contains community maintained DSC resources for deployment and configuration of Windows Server Update Services.
MIT License
31 stars 27 forks source link

Feature Request - Post Install #5

Closed Zuldan closed 8 years ago

Zuldan commented 8 years ago

It would be great to be able to have the post install feature in desired state. Currently using the dirty DSC script resource below to do the job.

Script WSUSPostInstall 
{
    DependsOn = '[File]WSUSContentDirectory'
    GetScript = {
        @{
            GetScript = $GetScript
            SetScript = $SetScript
            TestScript = $TestScript
            Result = ($null -ne (Get-Website -Name 'WSUS Administration') -and (Test-Path -Path "$($Using:Node.ServicesVolume)\WSUS\WsusContent\anonymousCheckFile.txt"))
        }           
    }

    SetScript = {
        & 'C:\Program Files\Update Services\Tools\WsusUtil.exe' postinstall CONTENT_DIR=$($Using:Node.ServicesVolume)\WSUS
    }

    TestScript = {
        $Status = ($null -ne (Get-Website -Name 'WSUS Administration') -and (Test-Path -Path "$($Using:Node.ServicesVolume)\WSUS\WsusContent\anonymousCheckFile.txt"))
        $Status -eq $True
    }
}
Zuldan commented 8 years ago

Sorry ignore this one. The resource already handles post install.