Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Importing module Microsoft.PowerShell.Archive fails because of culture not available when connecting from non en-US client to an en-US client via PSSession #57

Open
mlawindi opened this issue Apr 13, 2018 · 3 comments

Comments

@mlawindi
Copy link

Repro Steps:

  • Using a en-GB client (with thread culture and uiculture set to en-GB),
    - CurrentUICulture : en-GB
    - CurrentCulture : en-GB
  • Connect to an en-US remote machine using Enter-PSSession.
  • Run import-module Microsoft.Powershell.Archive -force will fail with:
    Import-LocalizedData : Cannot find the Windows PowerShell data file 'ArchiveResources.psd1' in directory 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Microsoft.Powershell.Archive\en-GB', or in any parent
    culture directories.
    At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Microsoft.Powershell.Archive\Microsoft.PowerShell.Archive.psm1:27 char:1
  • Import-LocalizedData LocalizedData -filename ArchiveResources
  •   + CategoryInfo          : ObjectNotFound: (C:\Windows\syst...eResources.psd1:String) [Import-LocalizedData], PSInvalidOperationException
      + FullyQualifiedErrorId : ImportLocalizedData,Microsoft.PowerShell.Commands.ImportLocalizedData
    
    
    

Is this expected? Shouldn't it use en-US since no en-GB on the remote machine?

@MarkusAmshove
Copy link

I do have the same problem on a fresh installation of Windows 10 with Powershell 6.0, German locale:

Import-LocalizedData : Cannot find the PowerShell data file 'ArchiveResources.psd1' in directory 'C:\program files\powershell\6.0.2\Modules\Microsoft.PowerShell.Archive\1.1.0.0\de-DE', or in any parent culture directories.
At C:\program files\powershell\6.0.2\Modules\Microsoft.PowerShell.Archive\1.1.0.0\Microsoft.PowerShell.Archive.psm1:28 char:1
+ Import-LocalizedData  LocalizedData -filename ArchiveResources
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (C:\program file...eResources.psd1:String) [Import-LocalizedData], PSInvalidOperationException
+ FullyQualifiedErrorId : ImportLocalizedData,Microsoft.PowerShell.Commands.ImportLocalizedData

@bondarenkod
Copy link

bondarenkod commented Jul 13, 2018

Try the workaround from my issue: #59
Probably, you need to copy&paste the original one from en-us to correspond folder e.g. 1.1.0.0\de-DE or en-GB
@MarkusAmshove @mlawindi

@fommo
Copy link

fommo commented Nov 14, 2023

I'm surprised this has yet not been solved. I just ran into this issue today creating a BC container in docker.
The workaround from @bondarenkod works, but still it's strange that this bug is still not solved.

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

No branches or pull requests

5 participants