Several errors
At C:\Users\administrator.DEGROOT\Downloads\PSHTML-AD.ps1:245 char:22
The '<' operator is reserved for future use. At C:\Users\administrator.DEGROOT\Downloads\PSHTML-AD.ps1:263 char:79
- ...
Missing file specification after redirection operator. At C:\Users\administrator.DEGROOT\Downloads\PSHTML-AD.ps1:379 char:10
The '<' operator is reserved for future use. At C:\Users\administrator.DEGROOT\Downloads\PSHTML-AD.ps1:384 char:210
- ... ck="(Logged out) Header, clicked Sign in, text:sign-in">Sign in< ...
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quot ation marks ("&") to pass it as part of a string.
Can you run the new version and let me know if you get this error No issues in test and prod

Thanks for your effort in helping me out! However i keep getting some errors, see picture attached.
im trying to figure out what it's even referencing, what country / language is your machine / AD set to
System Locale: nl;Dutch (Netherlands) Input Locale: en-us;English (United States)
AD language is english which is same as the OS.
Could that be the problem?
I am not 100% sure, I am not sure that these errors are even referencing but thats my only thought
I had similar errors and realized that right-click download doesn't work...it downloads the complete we page which is html not PS. clicking the link on the code page you are able to grab only the PS code.
Hope this helps!