For the full documentation, please visit the link below:
Creating a Custom Logon Script Using PowerShell and WPF