Examples/Resources/SPConfigWizard/2-RunConfigWizardInWindow.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<#
.EXAMPLE
    This example only runs the Configuration Wizard in the specified window:
    - Saturday and Sunday night between 3am and 5am.
#>


    Configuration Example 
    {
        param(
            [Parameter(Mandatory = $true)]
            [PSCredential]
            $SetupAccount
        )
        Import-DscResource -ModuleName SharePointDsc

        node localhost {
            SPConfigWizard RunConfigWizard
            {
                Ensure               = "Present"
                DatabaseUpgradeDays  = "sat", "sun"
                DatabaseUpgradeTime  = "3:00am to 5:00am"
                PsDscRunAsCredential = $SetupAccount
            }
        }
    }