microsoftgraph / microsoftgraph/entra-powershell

🪲 Module Microsoft.Entra.Beta.Applications can not be loaded in version 1.2.0

Open
#1,595 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Not EntraPowershell ToTriage
Dominant language
PowerShell
Stars
213
Forks
46
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

I am trying to install the Microsoft MCP Server for Enterprise based on https://learn.microsoft.com/en-us/graph/mcp-server/get-started?tabs=http%2Cvscode and the registration is failing

To Reproduce

Steps to reproduce the behavior:

  1. Execute Grant-EntraBetaMCPServerPermission -ApplicationName VisualStudioCode
  2. See error
Grant-EntraBetaMCPServerPermission : The 'Grant-EntraBetaMCPServerPermission' command was found in the module 'Microsoft.Entra.Beta.Applications', but the module could not be loaded. For more information, run 'Import-Module Microsoft.Entra.Beta.Applications'.
At line:1 char:1
+ Grant-EntraBetaMCPServerPermission -ApplicationName VisualStudioCode
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Grant-EntraBetaMCPServerPermission:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
  1. Execute Import-Module Microsoft.Entra.Beta.Applications
  2. See error
At C:\Program Files\WindowsPowerShell\Modules\Microsoft.Entra.Beta.Applications\1.2.0\Microsoft.Entra.Beta.Applications.psm1:4270 char:45
+ function Invoke-EntraBetaAgentIdInteractive {
+                                             ~
Missing closing '}' in statement block or type definition.
At C:\Program Files\WindowsPowerShell\Modules\Microsoft.Entra.Beta.Applications\1.2.0\Microsoft.Entra.Beta.Applications.psm1:4718 char:5
+     }
+     ~
Unexpected token '}' in expression or statement.
At C:\Program Files\WindowsPowerShell\Modules\Microsoft.Entra.Beta.Applications\1.2.0\Microsoft.Entra.Beta.Applications.psm1:4719 char:1
+ }
+ ~
Unexpected token '}' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingEndCurlyBrace

Import-Module : The module to process 'Microsoft.Entra.Beta.Applications.psm1', listed in field 'ModuleToProcess/RootModule' of module manifest 'C:\Program
Files\WindowsPowerShell\Modules\Microsoft.Entra.Beta.Applications\1.2.0\Microsoft.Entra.Beta.Applications.psd1' was not processed because no valid module was found in any module directory.
At line:1 char:1
+ Import-Module Microsoft.Entra.Beta.Applications
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (Microsoft.Entra.Beta.Applications:String) [Import-Module], PSInvalidOperationException
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Expected behavior

Module should be loaded without any error

Debug Output

Module Version

1.2.0

get-module Microsoft.Entra.Beta* -ListAvailable


    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.2.0      Microsoft.Entra.Beta                {Enable-EntraAzureADAlias, Get-EntraUnsupportedCommand, Test-EntraScript}
Script     1.2.0      Microsoft.Entra.Beta.Applications   {Add-EntraBetaApplicationOwner, Add-EntraBetaApplicationPolicy, Add-EntraBetaClientSecretToAgentIdentityBlueprint, Add-EntraBetaInheritablePermissionsToAgentIdentityBlueprint...}
Script     1.2.0      Microsoft.Entra.Beta.Authentication {Connect-Entra, Disconnect-Entra, Get-EntraContext, Get-EntraEnvironment...}
Script     1.2.0      Microsoft.Entra.Beta.DirectoryMa... {Add-EntraBetaAdministrativeUnitMember, Add-EntraBetaCustomSecurityAttributeDefinitionAllowedValue, Add-EntraBetaDeviceRegisteredOwner, Add-EntraBetaDeviceRegisteredUser...}
Script     1.2.0      Microsoft.Entra.Beta.Governance     {Get-EntraBetaDirectoryRoleAssignment, Get-EntraBetaDirectoryRoleDefinition, Get-EntraBetaPrivilegedResource, Get-EntraBetaPrivilegedRole...}
Script     1.2.0      Microsoft.Entra.Beta.Groups         {Add-EntraBetaGroupMember, Add-EntraBetaGroupOwner, Add-EntraBetaLifecyclePolicyGroup, Get-EntraBetaDeletedGroup...}
Script     1.2.0      Microsoft.Entra.Beta.NetworkAccess  {Enable-EntraBetaGlobalSecureAccessTenant, Get-EntraBetaGlobalSecureAccessTenantStatus, Get-EntraBetaPrivateAccessApplication, Get-EntraBetaPrivateAccessApplicationSegment...}
Script     1.2.0      Microsoft.Entra.Beta.Reports        {Get-EntraBetaApplicationSignInDetailedSummary, Get-EntraBetaApplicationSignInSummary, Get-EntraBetaAuditDirectoryLog, Get-EntraBetaAuditSignInLog...}
Script     1.2.0      Microsoft.Entra.Beta.SignIns        {Add-EntraBetaFeatureRolloutPolicyDirectoryObject, Add-EntraBetaServicePrincipalPolicy, Get-EntraBetaAuthorizationPolicy, Get-EntraBetaConditionalAccessPolicy...}
Script     1.2.0      Microsoft.Entra.Beta.Users          {Get-EntraBetaDeletedUser, Get-EntraBetaInactiveSignInUser, Get-EntraBetaUser, Get-EntraBetaUserAdministrativeUnit...}

Environment Data

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17763.8510
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.8510
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Screenshots

Image

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with PowerShell 5.1 using Import-Module Microsoft.Entra.Beta.Applications. Inspect Microsoft.Entra.Beta.Applications.psm1 around line 4270 and the corresponding module manifest for version 1.2.0. Done means the module imports successfully and Grant-EntraBetaMCPServerPermission can be invoked without the parser error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.