Microsoft.PowerShell.Archive
Microsoft.PowerShell.Archive copied to clipboard
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
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?
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
Try the workaround from my issue: https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/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
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.