PSU v5 with PowerShell 5.1 'Could not load file or assembly'

Appologies, I know a thread about this existed, but a prompt said it was solved and to open a new one.

I upgraded from v4 to v5.0.8 and I am seeing this issue with with PowerShell 5.1.

All of my script now thorw out the same error Could not load file or assembly. It also throws out errors that the module aren’t loaded, no matter if I set the environment to load all modules or import-module, The specified module 'Microsoft.Graph' was not loaded because no valid module file was found in any module directory

Initially after the uprage I had some old PowerShell Environment. I deleted all of these and did the auto detect, so now I have a PowerSheel 5 with the path of “Windows PowerShell 5.1” and it is stil lthrowing the same error.

Is there anything else I can do to get these scripts working again?

Did you verify that the module is installed in PSU and you can locate the module in your repository? Just thinking that it sounds like it got deleted somehow.

For reference, mine is located at C:\ProgramData\UniversalAutomation\Repository\Modules\Microsoft.Graph\2.14.1\Microsoft.Graph.psd1

Thanks Jesse,
I have checked and I do have the Microsoft.Graph modules listed in the \Repository\Modules folder.

1 Like

Good. I was just asking since that would be the most obvious reason for the error.

What is the environment set to on the scripts giving you this error? If it’s not defined, it would use whatever you have your default environment set to, so I’ll also ask what that’s set to.

We’ve got a support case open for this one and tracked it down to the PartnerCenter module: PartnerCenter Module does not work in Windows PowerShell · Issue #3855 · ironmansoftware/powershell-universal · GitHub

1 Like