Giter VIP home page Giter VIP logo

Comments (8)

ThoughtContagion avatar ThoughtContagion commented on July 25, 2024

Do you see the PnP. PowerShell module when you run this command?

Get-Module -ListAvailable | Where-Object {$_.Name -eq 'PnP.PowerShell'}

from 365inspect.

martinharris362 avatar martinharris362 commented on July 25, 2024

No it comes back blank. Even though I have installed it (several times)

from 365inspect.

martinharris362 avatar martinharris362 commented on July 25, 2024

Installed again and now shows

ModuleType Version PreRelease Name PSEdition ExportedCommands


Manifest 2.2.0 PnP.PowerShell

but still getting this

Connecting to Exchange Online
Connecting to SharePoint Service
Connecting to SharePoint Service Failed.
Write-Error: C:\365inspect\365Inspect-main\365Inspect.ps1:387
Line |
387 | Connect-Services
| ~~~~~~~~~~~~~~~~
| Could not load file or assembly 'Microsoft.Identity.Client, Version=4.50.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae'. Could not find or load a specific file. (0x80131621)

from 365inspect.

ThoughtContagion avatar ThoughtContagion commented on July 25, 2024

I am able to replicate that issue. We will work on a fix.

We can confirm that using PowerShell 5.1 (Windows PowerShell) and PnP.PowerShell version 1.12.0 works as expected.

We do also see several open and unresolved issues where this error is thrown in PowerShell 7+ using the PnP.PowerShell version 2+

from 365inspect.

ThoughtContagion avatar ThoughtContagion commented on July 25, 2024

We were able to resolve this issue.

The resolution was to forcefully remove the existing PnP.PowerShell module (in our case, this meant opening Explorer and navigating to C:\Users\User\Documents\PowerShell\Module\PnP.PowerShell and deleting the folder named 2.x).
You will need to close all instances of pwsh.exe - any open windows, VS Code if it is open, etc.
Once the module has been purged, reinstalling the module with the CurrentUser Scope allowed us to progress past the authentication screen without errors and run the assessment tool.

Install-Module -Name PnP.PowerShell -Scope CurrentUser -Force

from 365inspect.

martinharris362 avatar martinharris362 commented on July 25, 2024

Unfortunately still no joy. I'm getting a different error now regarding MS Identity client, which I have also freshly installed in current user scope

Environment is 7.4.0
[+] PowerShellGet is installed.
Importing PowerShellGet
Environment is 7.4.0
[+] ExchangeOnlineManagement is installed.
Inporting ExchangeOnlineManagement
Importing Microsoft.Graph
Environment is 7.4.0
[+] Microsoft.Graph is installed.
Inporting ExchangeOnlineManagement
Importing Microsoft.Graph
Get-Package: No match was found for the specified search criteria and module names 'PnP.PowerShell'.
InvalidArgument: C:\365inspect\365Inspect-main\365Inspect.ps1:269
Line |
269 | $installedVersion = [Version](((Get-InstalledModule -Name $mo …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert value "" to type "System.Version". Error: "Version string portion was too short or too long.
| (Parameter 'input')"
Environment is 7.4.0
[+] PnP.PowerShell is installed.
Environment is 7.4.0
[+] MicrosoftTeams is installed.
Importing MicrosoftTeams
Connecting to Microsoft Graph
Welcome to Microsoft Graph!

Connected via delegated access using 14d82eec-204b-4c2f-b7e8-296a70dab67e
Readme: https://aka.ms/graph/sdk/powershell
SDK Docs: https://aka.ms/graph/sdk/powershell/docs
API Docs: https://aka.ms/graph/docs

NOTE: You can use the -NoWelcome parameter to suppress this message.

Connected via Graph to xxxxxxxxxxxxxxx
Connecting to Security and Compliance Center


We have made updates to move the SCC admin experience to REST-based APIs. In doing so, we will be deprecating the legacy Remote PowerShell (RPS) protocol starting July 15, 2023.

Benefits of REST-based cmdlets: improved security, WinRM no longer required for client-server communication, improved error handling.

The REST API has the same cmdlets available and feature parity with RPS(V1) cmdlets, so existing scripts and processes don't need to be updated. Simply using the new module will ensure REST is used rather than RPS.

For more information, go to https://aka.ms/exov3-module

Connecting to Exchange Online
Connecting to SharePoint Service
Connecting to SharePoint Service Failed.
Write-Error: C:\365inspect\365Inspect-main\365Inspect.ps1:387
Line |
387 | Connect-Services
| ~~~~~~~~~~~~~~~~
| Could not load file or assembly 'Microsoft.Identity.Client, Version=4.50.0.0, Culture=neutral,
| PublicKeyToken=0a613f4dd989e8ae'. Could not find or load a specific file. (0x80131621)

from 365inspect.

martinharris362 avatar martinharris362 commented on July 25, 2024

Have removed everything and gone back to 5.1 and all good now

from 365inspect.

ThoughtContagion avatar ThoughtContagion commented on July 25, 2024

We've run into this issue with the MS Identity Client many times. It appears to be related to the various modules dependencies and packaged versions of the client. In some cases a newer version of a module has fixed it, in others we've needed to revert to the last known working versions of several modules.

If it helps, this is the current versioning running on my machine and everything works as expected with the fix listed above.
We do still caution using the tool with PS Core as some functionality will be limited in specific PowerShell modules, but we strive to support it regardless.

image

Thank you for using our tool, we hope it provides you with some valuable insight!
Please do not hesitate to reach back out with any additional issues, questions, or feature requests.

from 365inspect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.