Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail to get SmbLocalization.psd1 when Culture not en-US #157

Open
fmata-afk-zz opened this issue Aug 4, 2020 · 11 comments
Open

fail to get SmbLocalization.psd1 when Culture not en-US #157

fmata-afk-zz opened this issue Aug 4, 2020 · 11 comments

Comments

@fmata-afk-zz
Copy link

When running the module on a environment with culture en-GB (can be checked with Get-Culture) the script fails to get SMB info on SmbLocalization.psd1
The path C:\Windows\system32\WindowsPowerShell\v1.0\Modules\SmbShare\en-GB doens´t exist under module only the en-US.

@dl2n
Copy link
Collaborator

dl2n commented Aug 4, 2020 via email

@visvel
Copy link
Contributor

visvel commented Aug 4, 2020 via email

@dl2n
Copy link
Collaborator

dl2n commented Aug 4, 2020 via email

@visvel
Copy link
Contributor

visvel commented Aug 4, 2020

Sure Dan. @fmata-afk Can you please detail on the error?

@fmata-afk-zz
Copy link
Author

fmata-afk-zz commented Aug 5, 2020 via email

@visvel
Copy link
Contributor

visvel commented Aug 5, 2020

Upon reaching out to SMB team they seem to believes the issue is due to the en-GB langpack not installed.
From https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/add-language-packs-to-windows it seems to be specific to client os. Let me know if you are able to look to see on the langpack.

@fmata-afk-zz
Copy link
Author

fmata-afk-zz commented Aug 6, 2020 via email

@visvel
Copy link
Contributor

visvel commented Aug 6, 2020 via email

@visvel
Copy link
Contributor

visvel commented Aug 6, 2020 via email

@DennisL68
Copy link

DennisL68 commented Jul 17, 2022

This will fail even when running on an en-US combo of Windows 10 getting the module from Windows 2019 Server using WinRM.

>[environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      17763  0

>Get-Culture

LCID             Name             DisplayName
----             ----             -----------
1033             en-US            English (United States)

>$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17763.2931
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.2931
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
>[environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      19043  0

>Get-Culture

LCID             Name             DisplayName
----             ----             -----------
1033             en-US            English (United States)

>$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.1682
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1682
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
>$dc = New-PSSession -ComputerName DC

>Import-Module -PSSession $dc -Name SMBShare -Prefix DC

Import-Module : Failure from remote command: Import-Module -Name 'SMBShare': Cannot find the Windows PowerShell data
file 'SmbLocalization.psd1' in directory 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\SMBShare\en-GB\', or in
any parent culture directories.
At line:1 char:1
+ Import-Module -PSSession $dc -Name SMBShare -Prefix DC
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Windows\syst...calization.psd1:String) [Import-LocalizedData], PSInv
   alidOperationException
    + FullyQualifiedErrorId : ImportLocalizedData,Microsoft.PowerShell.Commands.ImportLocalizedData

For now, I just duplicated the folder en-US to en-GB on the server as a workaround...

@logicalextreme
Copy link

Still getting this issue 4 years later. What's weird is that on two different machines I've had no issues when initially using SmbShare cmdlets, then this bug started happening after a reboot. ¯_(ツ)_/¯

I don't consider changing CurrentUICulture to en-US or manually creating a (in my case) en-GB directory under the PS5 modules directory to be a fix, but appreciate that this is something the Windows PS team need to address. For now I've gone with duplicating the directory, but that's only going to work on my machines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants