Skip to content

Commit 79a18ed

Browse files
committed
fix hashtable detection
1 parent c3e9cb9 commit 79a18ed

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Runbooks/CloudAdmin_0000__Common_0002__Get-PrimaryAccountsByCloudAdminAccount.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,8 @@ if ($CloudAdminUserId.Count -gt 0) {
171171
@($CloudAdminUserId) | & {
172172
process {
173173
try {
174-
if ($_ -is [PSCustomObject]) {
175-
$userObj = $_
176-
Write-Verbose "[$i]: - Processing userId '$($_.Id)'."
177-
}
178-
else {
179-
Write-Verbose "[$i]: - Processing userId '$_'."
174+
if ($_ -is [string]) {
175+
Write-Verbose "[$i]: - Processing string userId '$_'."
180176

181177
try {
182178
$userObj = @(
@@ -218,6 +214,10 @@ if ($CloudAdminUserId.Count -gt 0) {
218214
return
219215
}
220216
}
217+
else {
218+
$userObj = $_
219+
Write-Verbose "[$i]: - Processing object userId '$($_.Id)'."
220+
}
221221

222222
if (
223223
$null -eq $userObj.onPremisesExtensionAttributes."extensionAttribute$ReferenceExtensionAttribute" -or
@@ -354,7 +354,7 @@ if ($CloudAdminUserId.Count -gt 0) {
354354
[void] $return.Add($refUserObj)
355355
}
356356
else {
357-
$existingRefUserObj.cloudAdminAccounts.Add($userObj)
357+
[void] $existingRefUserObj.cloudAdminAccounts.Add($userObj)
358358
}
359359
}
360360
finally {

0 commit comments

Comments
 (0)