Using GPEDIT or REGEDIT, make Windows run PowerShell scripts first at logon, logoff, startup, and shutdown before the OS runs other scripts.