-
Notifications
You must be signed in to change notification settings - Fork 108
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
Unable to run script - complains that Connect-PnPOnline is not recognised, even though it has been verified earlier in the script #83
Comments
Do you see the PnP. PowerShell module when you run this command? Get-Module -ListAvailable | Where-Object {$_.Name -eq 'PnP.PowerShell'} |
No it comes back blank. Even though I have installed it (several times) |
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 |
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+ |
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 Install-Module -Name PnP.PowerShell -Scope CurrentUser -Force |
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 Connected via delegated access using 14d82eec-204b-4c2f-b7e8-296a70dab67e NOTE: You can use the -NoWelcome parameter to suppress this message. Connected via Graph to xxxxxxxxxxxxxxx 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-moduleConnecting to Exchange Online |
Have removed everything and gone back to 5.1 and all good now |
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. Thank you for using our tool, we hope it provides you with some valuable insight! |
Here is the output from the script. It says PnP Powershell is installed
Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\365inspect\365Inspect-main\365Inspect.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): R
Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\365inspect\365Inspect-main\Write-ErrorLog.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): R
Verifying environment.
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
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 xxxxxxxxxxx
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
| ~~~~~~~~~~~~~~~~
| The term 'Connect-PnPOnline' is not recognized as a name of a cmdlet, function, script file, or executable
| program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
| again.
PS C:\365inspect\365Inspect-main>
The text was updated successfully, but these errors were encountered: