Fixing table sorting and S3 upload

This commit is contained in:
2025-10-21 13:35:09 +02:00
parent 0d9a460057
commit 5799881418
2 changed files with 19 additions and 8 deletions

View File

@@ -99,7 +99,7 @@ function Get-DomainDetailsFromSettings {
[hashtable]$Settings
)
$domainDetails = @{}
$domainDetails = [ordered]@{}
$counter = 1
while ($true) {
$nameKey = "Domain${counter}Name"
@@ -330,7 +330,7 @@ function Test-WeakADPasswords {
# User selects a domain
Write-Host "Select a domain to test:"
$DomainDetails.GetEnumerator() | ForEach-Object { Write-Host "$($_.Key): $($_.Value.Name)" }
$DomainDetails.GetEnumerator() | Sort-Object { [int]$_.Key } | ForEach-Object { Write-Host "$($_.Key): $($_.Value.Name)" }
$selection = Read-Host "Enter the number of the domain"
if (-not ($DomainDetails.ContainsKey($selection))) {