diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d5064d..073c1fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Starting with **v2.2.0**, Elysium uses a **unified project version**. All script - `Update-LithnetStore.ps1` ignored `InstallationPath`/`WeakPasswordsDatabase` and always looked for `khdb.txt` next to the script; it now resolves the same KHDB path as the other scripts. It also writes a transcript to `Reports/logs/` like the other operational scripts and uses the shared settings parser instead of its own copy. - The `Restart-WithPwshIfAvailable` / `Restart-WithWindowsPowerShellIfAvailable` relaunchers in `Elysium.Common.ps1` relaunched `Elysium.Common.ps1` itself instead of the calling script (`$PSCommandPath` inside a function is the file that defines it), then exited. Whenever a relaunch fired, the script silently did nothing: `Update-KHDB.ps1`, `Prepare-KHDBStorage.ps1`, `Update-LithnetStore.ps1` and `Uninstall.ps1` started from Windows PowerShell on a host with `pwsh` installed (including menu options 1, 4 and 5), and `Extract-NTHashes.ps1` / `Test-WeakADPasswords.ps1` started directly from `pwsh`. They now relaunch the calling script with its parameters. - `Update-KHDB.ps1 -MaxParallelTransfers N`, as documented in the README, was silently ignored: the script had no `param()` block, so the value never reached the downloader and PowerShell 7 always used 5 concurrent transfers. The script now declares and forwards the parameter (values outside 1-64 are rejected). +- `Update-LithnetStore.ps1` failed on every run right after opening the store: it called `.ToArray()` on its `HashSet[string]` source lists, but `ToArray` is a LINQ extension method that PowerShell cannot see, so PowerShell applied it to each string in the set and threw. The hash list always has at least one entry (configured sources or the default KHDB), so no list was ever imported. The lists are now enumerated through the pipeline. ### Changed - Elysium is becoming a PowerShell module (`src/Elysium`). The manifest's `ModuleVersion` is now the only place the version is defined; the per-file banner versions and `Bump-Version.ps1` are gone. Shared helpers moved from `Elysium.Common.ps1` into `src/Elysium/Private` (`Elysium.Common.ps1` is now a loader for them), and the KHDB updater is the first exported cmdlet, `Update-ElysiumKhdb`; `Update-KHDB.ps1` remains as a thin wrapper, so the menu and existing invocations are unchanged. diff --git a/Update-LithnetStore.ps1 b/Update-LithnetStore.ps1 index 1a692b0..10138df 100644 --- a/Update-LithnetStore.ps1 +++ b/Update-LithnetStore.ps1 @@ -143,17 +143,17 @@ try { Sync-HashesFromHibp } - foreach ($hashFile in ($hashSourcePaths.ToArray() | Sort-Object)) { + foreach ($hashFile in ($hashSourcePaths | Sort-Object)) { Write-Host ("Importing NTLM hash list '{0}'..." -f $hashFile) Import-CompromisedPasswordHashes -Filename $hashFile } - foreach ($plainFile in ($plaintextSourcePaths.ToArray() | Sort-Object)) { + foreach ($plainFile in ($plaintextSourcePaths | Sort-Object)) { Write-Host ("Importing plaintext password list '{0}'..." -f $plainFile) Import-CompromisedPasswords -Filename $plainFile } - foreach ($bannedFile in ($bannedWordSourcePaths.ToArray() | Sort-Object)) { + foreach ($bannedFile in ($bannedWordSourcePaths | Sort-Object)) { Write-Host ("Importing banned word list '{0}'..." -f $bannedFile) Import-BannedWords -Filename $bannedFile }