PowerShell script keeps closing without running code

You know PowerShell.exe has a help, don’t you? Have you read it?

powershell /?

Have you tried providing the full path of both - the PowerShell executable AND the script file?

I’d tried to run a script like this if I’m unsure about it:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -NoExit -File '<Full Path To Your Script File>\Clear-RecycleBin.ps1'
1 Like