summaryrefslogtreecommitdiff
path: root/ansible/scripts/dc-wait-for-ready.ps1
blob: afdf8ee2c1e2036c5ef6c3c9a17650801f53979d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$scriptName = $MyInvocation.MyCommand.Name
$logFile = "C:\Logs\${scriptName}_log.txt"
Start-Transcript -Path $logFile -Append

while ($true) {
    try {
        Write-Host "[INFO] Checking if domain is ready"
        Get-ADDomain
        break
    } catch {
        Write-Host "[INFO] Sleeping for 60s"
        Start-Sleep -Seconds 60
    }
}

Write-Host "[INFO] Domain is ready"
Stop-Transcript