Result :
PS C:\Users\Administrateur> C:\Users\Administrateur\Documents\testScript.ps1
Install hardeningKitty and configure it as a persistent PowerShell module
[INFO] Starting installation of HardeningKitty...
[INFO] Execution policy is already set to RemoteSigned
[INFO] Current installed version: 0.9.3
[INFO] Fetching the latest version of HardeningKitty...
[INFO] Latest version detected: 0.9.3
[INFO] HardeningKitty version 0.9.3 is already installed and up-to-date.
\n------------------------------------------------------\n
Find matching lists based on OS Name and OS Version
[INFO] Matching finding list with OS version...
[INFO] Detected OS Version: 21h2
[INFO] Detected OS Version: Get the current OS version 21h2
[INFO] Detected OS Name: microsoft windows server 2022 standard evaluation
[INFO] Formatted OS Name: windows_server_2022
[INFO] Detected OS Version: windows_server_2022
[INFO] Looking for the latest HardeningKitty version in C:\Program Files\WindowsPowerShell\Modules\HardeningKitty
[INFO] Using HardeningKitty module path: C:\Program Files\WindowsPowerShell\Modules\HardeningKitty\0.9.3
[INFO] Using HardeningKitty module path: Get the path of HardeningKitty module C:\Program Files\WindowsPowerShell\Modules\HardeningKitty\0.9.3
[INFO] Checking if lists directory exists at Get the path of HardeningKitty module C:\Program Files\WindowsPowerShell\Modules\HardeningKitty\0.9.3\lists
[ERROR] Lists directory does not exist.
[INFO] Detected OS Version: Get HardeningKitty lists
Impossible d’appeler une méthode dans une expression Null.
Au caractère C:\Users\Administrateur\Documents\testScript.ps1:221 : 13
+ if ($list.ToLower() -match $Os_Version -and $list.ToLower() - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation : (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
[INFO] No matching lists found for OS version: Get the current OS version 21h2