Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

How to Fix the Term Select-MgProfile is not Recognized Error

August 23, 2023
in Blog, Microsoft Graph, Powershell
0
ADVERTISEMENT

Table of Contents

Recently, Microsoft released the Microsoft Graph PowerShell SDK V2 module, which includes numerous improvements such as simplified authentication, improved error handling, and enhanced speed. Excited to explore the latest version, I decided to give it a try. 

However, when attempting to switch to the beta version due to the limited attribute retrieval in the SDK V2, I encountered the following error:

Select-MgProfile: The term ‘Select-MgProfile’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Microsoft Graph SDK V2- Functionality Change

Previously, users had to utilize Select-MgProfile beta to load beta commands and Select-MgProfile v1.0 to load v1.0 commands.

PS C:\> Select-MgProfile -Name beta

PS C:\> Get-MgProfile

Name Description
---- -----------
beta A snapshot of the Microsoft Graph beta API for the Global cloud.

PS C:\> Get-InstalledModule Microsoft.Graph | ft -AutoSize

Version Name            Repository Description
------- ----            ---------- -----------
1.28.0  Microsoft.Graph PSGallery  Microsoft Graph PowerShell module

However, with the introduction of MS Graph PowerShell V2, beta features can no longer be accessed directly. Instead, you need to install the MS Graph PowerShell beta module separately.

This change brings a significant benefit to users targeting the beta endpoint. Beta commands will now coexist alongside v1.0 commands, eliminating the need for using Select-MgProfile beta to load beta commands. It also allows using both v1.0 and beta cmdlets within the same script without requiring a full module reload.

Install MS Graph PowerShell Module:

To install the latest MS Graph PowerShell SDK, run the following cmdlet:

Install-Module Microsoft.Graph -AllowClobber

If you already have the MS Graph module installed and want to upgrade it to the latest version, use this cmdlet:

Update-Module Microsoft.Graph

Please note that the above command will only upgrade the V1.0 module. As mentioned earlier, you still need to install the beta module separately to use MS Graph PowerShell beta cmdlets.

To install the Microsoft Graph beta module, use the following command:

Install-Module Microsoft.Graph.Beta -AllowClobber

The beta module cmdlets will have the prefix Beta, such as Get-MgBetaUser or Get-MgBetaUserLicenseDetails.

With this change, customers targeting beta endpoint will no longer need to use Select-MgProfile beta to load beta commands as beta commands will exist side-by-side with v1.0 commands. This will also allow for mixing on v1.0 and beta commands in the same script without needing to reload the entire module.

#With v1 of the Microsoft Graph PowerShell SDK
Connect-MgGraph
Select-MgProfile beta
$BetaUsers = Get-MgUser
Select-MgProfile v1.0
$V1Users = Get-MgUser

#With v2 of the Microsoft Graph PowerShell SDK
Connect-MgGraph
$BetaUsers = Get-MgBetaUser
$V1Users = Get-MgUser

New Features and Improvements

The following new features and improvements have been added to the module in v2.

Not a reader? Watch this related video tutorial:

5/5 - (2 votes)
Previous Post

Configuring Scopes when Connecting to the Microsoft Graph PowerShell API

Next Post

How to Configure or Change the PowerShell Default Working Directory

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory