I can tell you that one way is in the following PowerShell environment path. . .
"$ENV:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"
Another way is through the registry. . .
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband"
. . .with names like "Favorites", "FavoritesChanges", "Pinned", and "LayoutCycle"
You would have to share your PowerShell code you have so far before we can offer any help, but those are some places you could look at.