summaryrefslogtreecommitdiff
path: root/ansible/scripts/dc-wait-for-ready.ps1
blob: 246f0a304b691e8916598338e966ebe3c8ecfca1 (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 "[inf] Checking if domain is ready"
        Get-ADDomain
        break
    } catch {
        Write-Host "[inf] Sleeping for 60s"
        Start-Sleep -Seconds 60
    }
}

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