chore: fix switch statements

This commit is contained in:
2025-07-31 10:42:08 +10:00
parent 72e37708b5
commit 66ddb7365b

View File

@ -66,16 +66,14 @@ foreach ($ou in @(
"Servers", "Servers",
"Workstations" "Workstations"
)) { )) {
switch ($ou) { if ($ou -eq "LAB") {
"LAB" { $path = $DefaultOUPath
$path = $DefaultOUPath }
} elseif ($ou -in @("Users","Groups","Computers")) {
"Users","Groups","Computers" { $path = $LABOU
$path = $LABOU }
} else {
"Servers","Workstations" { $path = "OU=Computers,$LABOU"
$path = "OU=Computers,$LABOU"
}
} }
if (-not (Get-ADOrganizationalUnit -LDAPFilter "(name=$ou)" -SearchBase $path -ErrorAction SilentlyContinue)) { if (-not (Get-ADOrganizationalUnit -LDAPFilter "(name=$ou)" -SearchBase $path -ErrorAction SilentlyContinue)) {