Skip to content
This repository was archived by the owner on Sep 22, 2023. It is now read-only.
This repository was archived by the owner on Sep 22, 2023. It is now read-only.

New-MsalClientApplication : Cannot convert argument "builder" #68

@JorgaWetzel

Description

@JorgaWetzel

Hello,

I was able to successfully send this command:

Connect-MgGraph
$Current_MgContext = Get-MgContext
$Global:AccessToken = Get-MsalToken -ClientID $Current_MgContext.ClientId -TenantId $Current_MgContext.TenantId

but then suddenly i have this persistent error:

New-MsalClientApplication : Cannot convert argument "builder", with value:
"Microsoft.Identity.Client.PublicClientApplicationBuilder", for "WithDesktopFeatures" to type
"Microsoft.Identity.Client.PublicClientApplicationBuilder": "Cannot convert the
"Microsoft.Identity.Client.PublicClientApplicationBuilder" value of type
"Microsoft.Identity.Client.PublicClientApplicationBuilder" to type
"Microsoft.Identity.Client.PublicClientApplicationBuilder"."
At C:\Program Files\WindowsPowerShell\Modules\MSAL.PS\4.37.0.0\Select-MsalClientApplication.ps1:56 char:29

  • ... plication = New-MsalClientApplication -ErrorAction Stop @paramNewMsal ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [New-MsalClientApplication], MethodException
    • FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument,New-MsalClientApplication

But this error is machine dependent, on another PC it runs fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions