I saw basically the same thing when I tested that code. The dark window you mentioned is the PowerShell console, but it doesn't have to stay open very long, because all it's doing is loading up your scheduled job scriptblock and invoking it. I'm not sure if it would be any help to try to leave that PowerShell window open, as it is just being launched with these parameters:
-NoLogo -NonInteractive -WindowStyle Hidden -Command "Import-Module PSScheduledJob; $jobDef = [Microsoft.PowerShell.ScheduledJob.ScheduledJobDefinition]::LoadFromStore(' LaunchSite', 'C:\Users\UserName\AppData\Local\Microsoft\Windows\PowerShell\ScheduledJobs'); $jobDef.Run()"