We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Connect-MgGraph
1 parent f24f93a commit ed1be7eCopy full SHA for ed1be7e
1 file changed
src/Arcus.Scripting.Tests.Integration/Connect-MgGraphFromConfig.ps1
@@ -17,4 +17,11 @@ $connection = Invoke-RestMethod `
17
18
$token = $connection.access_token
19
20
-Connect-MgGraph -AccessToken $token
+$targetParameter = (Get-Command Connect-MgGraph).Parameters['AccessToken']
21
+
22
+if ($targetParameter.ParameterType -eq [securestring]) {
23
+ Connect-MgGraph -AccessToken ($token |ConvertTo-SecureString -AsPlainText -Force)
24
+}
25
+else {
26
+ Connect-MgGraph -AccessToken $token
27
0 commit comments