microsoftgraph / microsoftgraph/entra-powershell

🪲 Import-Module Microsoft.Entra.Applications / Microsoft.Entra..Beta.Applications throws an error 1.3.0

Open
#1,603 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Thanks for reporting the bug. Please ensure you've gone through the following checklist before opening an issue:

  • Make sure you can reproduce this issue using the latest released version of Microsoft.Entra or Microsoft.Entra.Beta.
  • Please search the existing issues to see if there has been a similar issue filed.

Describe the bug

Import-Module throws an error (Module Version 1.3.0)

Import-Module Microsoft.Entra.Applications
Import-Module Microsoft.Entra..Beta.Applications

Import-Module Microsoft.Entra.Applications
At C:\Users\a.bohren\OneDrive -
Icewolf\Dokumente\WindowsPowerShell\Modules\Microsoft.Entra.Applications\1.3.0\Microsoft.Entra.Applications.psm1:1562
char:78
+ ... # Resolve BlueprintId: explicit param → stored → prompt → error
+                                                                          ~
Missing closing ')' in expression.
At C:\Users\a.bohren\OneDrive -
Icewolf\Dokumente\WindowsPowerShell\Modules\Microsoft.Entra.Applications\1.3.0\Microsoft.Entra.Applications.psm1:1603
char:2
+ }
+  ~
The Try statement is missing its Catch or Finally block.
At C:\Users\a.bohren\OneDrive -
Icewolf\Dokumente\WindowsPowerShell\Modules\Microsoft.Entra.Applications\1.3.0\Microsoft.Entra.Applications.psm1:3614
char:41
+ function Invoke-EntraAgentIdInteractive {
+                                         ~
Missing closing '}' in statement block or type definition.
At C:\Users\a.bohren\OneDrive -
Icewolf\Dokumente\WindowsPowerShell\Modules\Microsoft.Entra.Applications\1.3.0\Microsoft.Entra.Applications.psm1:203
char:66
+ function Add-EntraInheritablePermissionsToAgentIdentityBlueprint {
+                                                                  ~
Missing closing '}' in statement block or type definition.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingEndParenthesisInExpression

Import-Module : The module to process 'Microsoft.Entra.Applications.psm1', listed in field
'ModuleToProcess/RootModule' of module manifest 'C:\Users\a.bohren\OneDrive -
Icewolf\Dokumente\WindowsPowerShell\Modules\Microsoft.Entra.Applications\1.3.0\Microsoft.Entra.Applications.psd1' was
not processed because no valid module was found in any module directory.
At line:1 char:73
+ ... Write-Host "ModuleName: $($Module.Name)"; Import-Module $Module.Name}
+                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (Microsoft.Entra.Applications:String) [Import-Module], PSInvalidOpe
   rationException
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module Microsoft.Entra.Beta.Applications
At C:\Users\a.bohren\OneDrive - Icewolf\Dokumente\WindowsPowerShell\Modules\Microsoft.Entra.Beta.Applications\1.3.0\Mic
rosoft.Entra.Beta.Applications.psm1:1596 char:78
+ ... # Resolve BlueprintId: explicit param → stored → prompt → error
+                                                                          ~
Missing closing ')' in expression.
At C:\Users\a.bohren\OneDrive - Icewolf\Dokumente\WindowsPowerShell\Modules\Microsoft.Entra.Beta.Applications\1.3.0\Mic
rosoft.Entra.Beta.Applications.psm1:1637 char:2
+ }
+  ~
The Try statement is missing its Catch or Finally block.
At C:\Users\a.bohren\OneDrive - Icewolf\Dokumente\WindowsPowerShell\Modules\Microsoft.Entra.Beta.Applications\1.3.0\Mic
rosoft.Entra.Beta.Applications.psm1:4345 char:45
+ function Invoke-EntraBetaAgentIdInteractive {
+                                             ~
Missing closing '}' in statement block or type definition.
At C:\Users\a.bohren\OneDrive - Icewolf\Dokumente\WindowsPowerShell\Modules\Microsoft.Entra.Beta.Applications\1.3.0\Mic
rosoft.Entra.Beta.Applications.psm1:269 char:70
+ ... unction Add-EntraBetaInheritablePermissionsToAgentIdentityBlueprint {
+                                                                         ~
Missing closing '}' in statement block or type definition.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingEndParenthesisInExpression

Import-Module : The module to process 'Microsoft.Entra.Beta.Applications.psm1', listed in field
'ModuleToProcess/RootModule' of module manifest 'C:\Users\a.bohren\OneDrive - Icewolf\Dokumente\WindowsPowerShell\Modul
es\Microsoft.Entra.Beta.Applications\1.3.0\Microsoft.Entra.Beta.Applications.psd1' was not processed because no valid
module was found in any module directory.
At line:1 char:73
+ ... Write-Host "ModuleName: $($Module.Name)"; Import-Module $Module.Name}
+                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (Microsoft.Entra.Beta.Applications:String) [Import-Module], PSInval
   idOperationException
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

To Reproduce

Steps to reproduce the behavior:

Import-Module Microsoft.Entra.Applications
Import-Module Microsoft.Entra..Beta.Applications

Expected behavior

Import

Debug Output

Module Version

Get-Module -Name "Microsoft*Entra*"

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.3.0      Microsoft.Entra.Authentication      {Add-EntraEnvironment, Connect-Entra, Disconnect-Entra, Fi...
Script     1.3.0      Microsoft.Entra.Beta.Authentication {Connect-Entra, Disconnect-Entra, Get-EntraContext, Get-En...
Script     1.3.0      Microsoft.Entra.Beta.DirectoryMa... {Add-EntraBetaAdministrativeUnitMember, Add-EntraBetaCusto...
Script     1.3.0      Microsoft.Entra.Beta.Governance     {Get-EntraBetaDirectoryRoleAssignment, Get-EntraBetaDirect...
Script     1.3.0      Microsoft.Entra.Beta.Groups         {Add-EntraBetaGroupMember, Add-EntraBetaGroupOwner, Add-En...
Script     1.3.0      Microsoft.Entra.Beta.NetworkAccess  {Enable-EntraBetaGlobalSecureAccessTenant, Get-EntraBetaGl...
Script     1.3.0      Microsoft.Entra.Beta.Reports        {Get-EntraBetaApplicationSignInDetailedSummary, Get-EntraB...
Script     1.3.0      Microsoft.Entra.Beta.SignIns        {Add-EntraBetaFeatureRolloutPolicyDirectoryObject, Add-Ent...
Script     1.3.0      Microsoft.Entra.Beta.Users          {Get-EntraBetaAgentUser, Get-EntraBetaDeletedUser, Get-Ent...
Script     1.3.0      Microsoft.Entra.CertificateBased... {Get-EntraUserCBAAuthorizationInfo, Get-EntraUserCertifica...
Script     1.3.0      Microsoft.Entra.DirectoryManagement {Add-EntraAdministrativeUnitMember, Add-EntraCustomSecurit...
Script     1.3.0      Microsoft.Entra.Governance          {Get-EntraDirectoryRoleAssignment, Get-EntraDirectoryRoleD...
Script     1.3.0      Microsoft.Entra.Groups              {Add-EntraGroupMember, Add-EntraGroupOwner, Add-EntraLifec...
Script     1.3.0      Microsoft.Entra.Reports             {Get-EntraAuditDirectoryLog, Get-EntraAuditSignInLog, Get-...
Script     1.3.0      Microsoft.Entra.SignIns             {Get-EntraAuthorizationPolicy, Get-EntraConditionalAccessP...
Script     1.3.0      Microsoft.Entra.Users               {Get-EntraAgentUser, Get-EntraDeletedUser, Get-EntraInacti...


Environment Data

$PSVersionTable

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

Screenshots

Additional context

Kind Regards
Andres

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

Reproduce the failure with Import-Module Microsoft.Entra.Applications and Microsoft.Entra.Beta.Applications using version 1.3.0. Inspect Microsoft.Entra.Applications.psm1 around lines 1562 and 1603, and Microsoft.Entra.Beta.Applications.psm1 around lines 1596 and 1637, where the parser reports missing delimiters. Done means both modules import successfully without parser errors.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.