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

Import-Module : Could not load file or assembly #19

Closed
adrianwells opened this issue Jan 23, 2019 · 6 comments
Closed

Import-Module : Could not load file or assembly #19

adrianwells opened this issue Jan 23, 2019 · 6 comments

Comments

@adrianwells
Copy link

adrianwells commented Jan 23, 2019

Experiencing the similar experience issue #2 when attempting to load the module Import-Module ./Microsoft.Graph.Intune.psd1

Results in an error:

Intune-PowerShell-SDK\6.1902.00745.0001-release-97194499-net471\drop\outputs\build\Release\net471\Microsoft.Intune.PowerShellGraphSDK.dll' or one of its dependencies. Operation is not supported. (Exception
from HRESULT: 0x80131515)
At line:1 char:1
+ Import-Module ./Microsoft.Graph.Intune.psd1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Import-Module], FileLoadException
    + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand

with Release Preview 3, however, unblocking the net471\Microsoft.Intune.PowerShellGraphSDK.dll file is not yet resolving this error. Tried with elevated privileges. Working with Windows 10 Version 1803 with .NET framework version 4.7.2 (release 461808). Other suggestions to resolve?

@nsoy
Copy link
Contributor

nsoy commented Jan 23, 2019

looking..

@nsoy
Copy link
Contributor

nsoy commented Jan 23, 2019

See if the netstandard2.0 version works for you. I have created a separate redistributable for dot net core.
https://github.com/Microsoft/Intune-PowerShell-SDK/releases/tag/Preview3-netstandard2.0

@adrianwells
Copy link
Author

@nsoy Thanks for the reply, however, seeing the same result so far with the same error message:

Intune-PowerShell-SDK\6.1902.00745.0001-release-97194499-netstandard2.0\drop\outputs\build\Release\netstandard2.0\Microsoft.Intune.PowerShellGraphSDK.dll' or one of its dependencies. Operation is not
supported. (Exception from HRESULT: 0x80131515)
At line:1 char:1
+ Import-Module ./Microsoft.Graph.Intune.psd1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Import-Module], FileLoadException
    + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand

Unblocked the Microsoft.Intune.PowerShellGraphSDK.dll file as directed in the readme.md. Other suggestions?

@adrianwells
Copy link
Author

adrianwells commented Jan 25, 2019

@nsoy - trying again with a privileged account, it appears the netstandard2.0 version is now loading:

Intune-PowerShell-SDK\6.1902.00745.0001-release-97194499-netstandard2.0\drop\outputs\build\Release\netstandard2.0> get-module -name Microsoft.Graph.Intune

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Binary     6.1902.0.1 Microsoft.Graph.Intune              {Connect-MSGraph, Get-AADGroup, Get-AADGroupCreatedOnBehalfOf, Get-AADGroupCreatedOnBehalfOfReference...}

Maybe worth adding a few notes in the Readme or elsewhere about this requirement? Or add a check for whether the PowerShell session has proper rights?

@adrianwells
Copy link
Author

@nsoy, FYI - the prior comment is for the GitHub prelease version. The most recent version (1902) from PowerShell gallery looks to be working well and does not appear to require privileged access.

@nsoy
Copy link
Contributor

nsoy commented Jan 30, 2019

I have pushed the module to powershell gallery - try install-module and report issues loading assemblies if any. Thanks!

@nsoy nsoy closed this as completed Jan 30, 2019
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

2 participants