PowerShell – Resolving Issue – PnP.PowerShell module not getting installed / updated – small learning

PnP PowerShell - Import-Module PnP.PowerShell - Exception old version of Windows PowerShell installed
PnP PowerShell - Import-Module PnP.PowerShell - Exception old version of Windows PowerShell installed

Hi All,

Greetings for the day!!!

Today, one more issue and solution.

Background

  • I need to create new client application (appid / clientid) in Microsoft Entra.
  • I am executing PowerShell CMDLET – Register-PnPEntraIDAppForInteractiveLogin
Register-PnPEntraIDAppForInteractiveLogin -ApplicationName "LIFE IS BEAUTIFUL" -SharePointDelegatePermissions "AllSites.FullControl" -Tenant knowledgejunction1.onmicrosoft.com -Interactive

  • Since I was trying this CMDLET on my local computer, I need to install the PnP PowerShell module.
  • To just make sure, no PnP PowerShell module is installed, I am executing CMDLET – Get-Module.
  • but I am not getting any result.
Get-Module PnP.PowerShell
PnP PowerShell - no result for Get-Module PnP.PowerShell
fig: PnP PowerShell – no result for Get-Module PnP.PowerShell
  • Get-Module CMDLET not returning any result.
  • Next, I am executing Install-Module CMDLET to install the PnP PowerShell module
Install-Module PnP.PowerShell

  • But nothing was happening.
  • Install-Module CMDLET also not returning any result as shown in image below.
PnP PowerShell - no result for Install-Module PnP.PowerShell
fig: PnP PowerShell – no result for Install-Module PnP.PowerShell
  • I was wondering why PnP.PowerShell module is not getting installed.
  • There is no warning, no error.
  • So finally started googling and in one of the article found that try to import module explicitly using CMDLET – Import-Module
  • Executed the CMDLET – Import-Module
Import-Module PnP.PowerShell

PnP PowerShell - Import-Module PnP.PowerShell
fig: PnP PowerShell – Import-Module PnP.PowerShell – Exception old version of Windows PowerShell installed
  • We got an error while importing PnP.PowerShell module as shown in image above.
  • From error, it seems that we have old version Windows PowerShell.
  • To use PnP.PowerShell we require minimum version 7.2 of Windows PowerShell.
  • We have upgraded to Windows PowerShell 7.2 and PnP.PowerShell started working like charm 🙂

REFERENCES

Thanks for reading !

HAPPY LEARNING AHEAD 🙂 LIFE IS BEAUTIFUL 🙂

Prasham Sabadra

LIFE IS VERY BEAUTIFUL. ENJOY THE WHOLE JOURNEY :) Founder of Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading