After moving from 2.6.2 to 2.7.0 I’ve been experiencing issues with several of my Automation Tools throwing React 31 errors when trying to build a list of buttons from a prebuilt array.
My Code Example
New-UDCard -Title "Single Group Removal" -Content {
New-UDInput -Title "Enter NetID" -Content {
New-UDInputField -Type textbox -Name 'NewUser' -Placeholder "Enter New Users NetID"
} -Endpoint {
param($newuser)
$Cache:strSIDusr,$strusr = Get-Sid -netid $newuser
$Cache:newusr = $newuser
[array]$Cache:grpstr = Get-ADGroup -Filter {member -eq $strusr} | Select-Object -ExpandProperty Name
[array]$Session:fgp = Get-ADGroup -filter {name -like "*" -and member -eq $strusr} | Select-Object -ExpandProperty distinguishedName
New-UDInputAction -Content @(
New-UDCard -Title "Select Groups to Remove User Access From:" -Content {
for($i=0; $i -lt $Cache:grpstr.Length;$i++) {
New-UDButton -Text $Cache:grpstr[$i] -OnClick(
New-UDEndpoint -Endpoint {
$group = New-Object DirectoryServices.DirectoryEntry("LDAP://$($Session:fgp[$ArgumentList[0]])")
[void]$group.member.Remove("<SID=$($ArgumentList[1])>")
$group.CommitChanges()
$group.Close()
$gname = $Cache:grpstr[$ArgumentList[0]]
Show-UDToast -Message "User Removed to Group"
Add-Content -Path $Cache:logpath -Value "$Cache:DateString - $User removed $Cache:newusr from $gname" -ErrorAction SilentlyContinue
} -ArgumentList @($i,$Cache:strSIDusr)
)
}
} -Links @(
New-UDLink -Text 'Reset' -Url 'SupportTools'
)
)
}
I have several tools that work like this that my support team uses to onboard / offboard users. In 2.6.2 I never saw these react errors but after moving to 2.7.0 it seems all of the tools that have these InputActions to build a list of buttons throw the React 31 error from above.
Has anyone seen this issue before or might have some insight into what might be going on? I’m going to continue testing and see if I can find anything but I figured I’d tap the ultimate brain power here as well.
Thanks!