Install-Module Microsoft Graph PowerShell Module

Glenn Maxwell 6,891 Reputation points
2022-09-06T05:47:58.32+00:00

Hi All

I am getting below error installing Microsoft.Graph powershell module please guide me

PS C:\Windows\system32> Install-Module Microsoft.Graph -Scope AllUsers
PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'Microsoft.Graph'. Try Get-PSRepository to see all available registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21

  • ... $null = PackageManagement\Install-Package @PSBoundParameters
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
  • FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

PS C:\Windows\system32> Get-PSRepository
WARNING: Unable to find module repositories.

Microsoft Graph Identity API
Microsoft Graph Identity API
A Microsoft API to access Azure Active Directory (Azure AD) resources to enable scenarios like managing administrator (directory) roles, inviting external users to an organization, and, if you are a Cloud Solution Provider (CSP), managing your customer's data.
272 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,751 questions
No comments
{count} votes

Accepted answer
  1. Vasil Michev 66,616 Reputation points MVP
    2022-09-06T06:38:22.127+00:00

    You need to add the PowerShell Gallery repository first:

    Register-PSRepository -Default  
    

3 additional answers

Sort by: Most helpful
  1. Glenn Maxwell 6,891 Reputation points
    2022-09-06T10:27:58.407+00:00

    238176-er.jpg

  2. Glenn Maxwell 6,891 Reputation points
    2022-09-06T14:24:06+00:00

    The below should fix it, let me try it

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

    Unregister-PSRepository -Name PSGallery
    Register-PSRepository -Default

  3. Glenn Maxwell 6,891 Reputation points
    2022-09-06T14:49:34.207+00:00

    The below fixed it

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    Unregister-PSRepository -Name PSGallery
    Register-PSRepository -Default