Skip to content

Critical Failures: Syntax Errors, Missing Dependencies, and MSAL Assembly Conflicts #1

Description

@Ryan-Adams57

A spot check of approximately 12 scripts in this repository revealed a failure rate of roughly 75%. Issues range from fundamental PowerShell syntax errors to complex DLL version conflicts. It is recommended to withhold these scripts from general use until these stability issues are addressed.

  1. Syntax & Parser Errors (Script 00)

Missing Closures: Multiple unclosed try blocks, foreach loops, and if statements result in ParseException.

Reserved Characters: Unquoted ampersands (&) in Write-Host strings (Line 250) trigger parser errors.

Missing Blocks: Try statements are missing required Catch or Finally blocks.

  1. Missing Module Dependencies (Scripts 01, 02)

Error: The term 'Get-MgSubscribedSku' is not recognized.

Cause: The scripts assume Microsoft.Graph is a monolith.

Fix: Explicitly require and import Microsoft.Graph.Identity.DirectoryManagement.

  1. MSAL/Broker Assembly Conflicts (Scripts 03, 04, 16)

Error: Method not found: '...BrokerExtension.With Broker...'

Context: Occurs during Connect-ExchangeOnline.

Cause: A version mismatch in Microsoft.Identity.Client.dll loaded into the PowerShell session, often caused by conflicting versions between the Graph and Exchange modules.

  1. Authentication Failures (Script 51)

Error: InteractiveBrowserCredential authentication failed.

Context: Failure to launch or complete the OAuth2 flow even when run with Global Admin privileges in an elevated session.

Environment Tested

Privilege: Admin PowerShell / Global Admin Account

Machine: Clean Environment

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions