HotCakeX / Harden-Windows-Security

Harden Windows Safely, Securely using Official Supported Microsoft methods and proper explanation | Always up-to-date and works with the latest build of Windows | Provides tools and Guides for Personal, Enterprise, Government and Military security levels | Read The Rationale https://github.com/HotCakeX/Harden-Windows-Security/blob/main/Rationale.md
https://hotcakex.github.io
MIT License
1.84k stars 143 forks source link

[Bug]: Confirm-SystemCompliance error #127

Closed Ainatar closed 1 year ago

Ainatar commented 1 year ago

Tools category

Harden Windows Security Module

Does your system meet the requirements?

Is your Windows installation genuine?

Please explain the bug

Hello!

I dont know since when this is happening, but when i try to run the command 'Confirm-SystemCompliance' it fails with this error:

Confirm-SystemCompliance: The 'Get-SmbServerConfiguration' command was found in the module 'SmbShare', but the module could not be loaded. For more information, run 'Import-Module SmbShare'.

If i try running the 'Import-Module SmbShare' command it also fails with the next error:

Import-LocalizedData: Cannot find the PowerShell data file 'SmbLocalization.psd1' in directory 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\SmbShare\es-ES', or in any parent culture directories.

Any ideas? Thanks in advance.

HotCakeX commented 1 year ago

Hi, What happens when you run this in PowerShell as administrator?

Get-SmbServerConfiguration
Ainatar commented 1 year ago

Hi, What happens when you run this in PowerShell as administrator?

Get-SmbServerConfiguration

It displays a lot of info about the config, i can paste it if you need it.

HotCakeX commented 1 year ago

This looks like a bug with Windows PowerShell https://forums.powershell.org/t/smbshare-module-has-no-default-localisation-data-file/5465 https://stackoverflow.com/questions/76200280/smbshare-the-module-could-not-be-loaded

I can reproduce it too with es-ES language pack installed and set as Windows language. I will try to implement a workaround in the module and release an update Thanks for reporting it!

HotCakeX commented 1 year ago

Please use any of the module's cmdlets again to auto update it, the issue is fixed https://github.com/HotCakeX/Harden-Windows-Security/releases/tag/Hardening-Module-v.0.1.6.1