You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Graph.EasyPIM/Graph.EasyPIM.psm1
+113-7Lines changed: 113 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,15 @@ function Enable-PIMRole {
46
46
[Parameter(Mandatory=$false)]
47
47
[string]$TicketingSystem,
48
48
49
-
[switch]$RefreshEligibleRoles
49
+
[switch]$RefreshEligibleRoles,
50
+
51
+
[switch]$UseDeviceCode,
52
+
53
+
[Parameter(Mandatory=$false)]
54
+
[string]$TenantId,
55
+
56
+
[Parameter(Mandatory=$false)]
57
+
[string]$ClientId
50
58
)
51
59
52
60
<#
@@ -67,6 +75,14 @@ function Enable-PIMRole {
67
75
.PARAMETERRefreshEligibleRoles
68
76
Optional. By default, eligible roles are only checked if it's been more than 30 mins since the last invocation. If you want to check before that, use this switch.
69
77
78
+
.PARAMETERUseDeviceCode
79
+
Optional. Use Device Code authentication.
80
+
81
+
.PARAMETERTenantId
82
+
Optional. Use this TenantId.
83
+
84
+
.PARAMETERClientId
85
+
Optional. Use this Client Id.
70
86
#>
71
87
72
88
begin {
@@ -80,8 +96,18 @@ function Enable-PIMRole {
80
96
Write-Host@colorParams"🎉 A newer version of this module is available in PowerShell Gallery"
81
97
}
82
98
99
+
$graphParams=@{
100
+
"Scopes"=$script:requiredScopesArray
101
+
"NoWelcome"=$true
102
+
"ErrorAction"="Stop"
103
+
}
104
+
105
+
if ($UseDeviceCode) { $graphParams.UseDeviceCode=$true }
106
+
if ($TenantId) { $graphParams.TenantId=$TenantId }
107
+
if ($ClientId) { $graphParams.ClientId=$ClientId }
0 commit comments