Creating a dashboard for existing script

I have an existing script that searches several network shares and returns a list of folders that are System.IO.DirectoryInfo objects. This script has to run as a user with permission to access the top level folders (my admin user). I currently run my ps session as this user.
How does UD get access as that user? Additionally, the function is loaded when the session starts up. I assume I need to use the EndPointInitialization command and pass find-clientfolder to my -function parameter?

Hello @Tuxhedoh so at my work place one of the member of the IT team does not have the administrator password…however I done a dashboard which runs the PSFolderSize as this is running on my PC and I have admin rights, this would show the user all the folders and the sizes in a grid. I then built a search bar so that member of staff could drill down into what folder/file was using the space…anyways as the dashboard was running on my PC I didn’t have to specify any additional usernames / passwords it just all worked as the dashboard was on my pc, and I had the rights. hope this helps or gives ideas. Peace