Running ps1 as a scheduled task

Have a functioning script that sends users notification that password is expiring.
LSS, script works but having trouble automating it.
tried several arguments, none working
-File C:\PWC\pwc3.ps1 -RunType $true -Path C:\PWC
-ExecutionPolicy Bypass C:\PWC\pwc3.ps1 -RunType $true -Path C:\PWC

Randy,
Welcome to the forum. :wave:t4:

What exactly does that mean?

Are you sure the script does not run? Or could it be that you just don’t see the expected result? That could be caused by a few other reasons. :wink:

What account do you use to run the scheduled task? … for example … :wink:

BTW: When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in PowerShell.org <---- Click :point_up_2:t4: :wink:

That works for command lines as well.