I want to use the PSWindowsUpdate module latest version on multiple servers. So I downloaded it via PowerShell "install-module" and then copied the folder to a UNC share. Now when I try to import it, it usually provides this message:
> ipmo : Could not load file or assembly > 'file://\\server\share\Scripts\PSWindowsUpdate\188.8.131.52\PSWindowsUpdate.dll' > or one of its dependencies. Operation is not supported. (Exception > from HRESULT: 0x80131515) At line:1 char:1 > + ipmo \\server\share\Scripts\PSWindowsUpdate > + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + CategoryInfo : NotSpecified: (:) [Import-Module], FileLoadException > + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand
I am using Windows PowerShell, not the new PowerShell. I experience this problem mostly on Server 2016, which is the majority in my environment. Windows Server 2012 R2 does not give me a problem, nor 2019 (strangely).
I have already unblocked all the files, and my execution policy is Bypass. Running in x86 PowerShell doesn't help.
The problem seems to go away if the module files are stored locally; I would prefer not to copy/install this module to all my servers.
I can't tell why 2016 is complaining about it but not 2019. I wonder if there's a setting to trust this UNC path that I can apply.
Thanks in advance!
User contributions licensed under CC BY-SA 3.0