Self Referencing Loop Error

Got an interesting error trying to build a table from Identity References of NTFS folder permissions. What I’m trying to accomplish is to build a table of NTFS folder permissions from folder name inputs using Get-Acl cmdlet. When I try to select the IdentityReference and return it to the table I’m getting a Self Referencing Loop error.

Error:
image

Code Snippet:

I’ve looked around and it seems there is a way to disable this error in JSON but I’m afraid of breaking the entire thing trying to update that. I’ve built a service account for this purpose as well to make sure the dashboard has the proper read access to pull these results. Is this possible without disabling this error in JSON? I’ve tried multiple different approaches to this and all them lead me back to this same Loop error.

You probably could work around this by turning the IdentityReference into a string.

$results | % { [PSCustomObject]@{ IdentityReference = $_.IdentityReference.ToString() } | Out-UDTableData -Property @("IdentityReference")
2 Likes

That worked. I converting it to string yesterday and it failed on me for a different conversion reason. Your method got around that error as well. Thanks Adam.

1 Like