diff --git a/src/Arcus.Scripting.Tests.Integration/Connect-MgGraphFromConfig.ps1 b/src/Arcus.Scripting.Tests.Integration/Connect-MgGraphFromConfig.ps1 index 0f216613..9357bf51 100644 --- a/src/Arcus.Scripting.Tests.Integration/Connect-MgGraphFromConfig.ps1 +++ b/src/Arcus.Scripting.Tests.Integration/Connect-MgGraphFromConfig.ps1 @@ -17,4 +17,11 @@ $connection = Invoke-RestMethod ` $token = $connection.access_token -Connect-MgGraph -AccessToken $token \ No newline at end of file +$targetParameter = (Get-Command Connect-MgGraph).Parameters['AccessToken'] + +if ($targetParameter.ParameterType -eq [securestring]) { + Connect-MgGraph -AccessToken ($token |ConvertTo-SecureString -AsPlainText -Force) +} +else { + Connect-MgGraph -AccessToken $token +} \ No newline at end of file