I am scheduling a task from a WPF application using a PowerShell script but whenever this scheduler runs it blinks up the powershell window and goes within seconds.
I have already added arguments like this:
-WindowStyle Hidden -Execution Policy Bypass - NoProfile -File C:test.ps1
Even after adding -WindowStyle Hidden
it is not hiding the console. How to hide this console window?
I can't use a VB script as we are checking some conditions in a PowerShell script while scheduling the task. So is there any way we can disable or hide this window?