If Windows PowerShell keeps popping up randomly on your screen, the fix is usually to disable its startup entries in Task Manager or remove a scheduled task that triggers it. This article walks through the most common causes and the exact steps to stop it for good.
Why Does PowerShell Keep Opening?
PowerShell is a legitimate Windows tool, so it doesn’t appear on its own. Something on your system is telling it to run. The usual triggers are:
- Startup apps: A program or script in the Startup folder or registry launches PowerShell at logon.
- Scheduled tasks: Windows Task Scheduler runs a PowerShell script at a set time or event, which makes the window pop up even when you’re idle.
- Malware or unwanted software: Some adware and browser hijackers use PowerShell to run hidden commands, and the console window flashes briefly.
- File associations: A corrupted file association can make PowerShell open when you double-click certain file types.
- Keyboard shortcut or mouse button: A stuck or remapped key can trigger a shortcut that launches PowerShell.
If the window appears and disappears in a split second, it’s likely a scheduled task or a startup script. If it stays open, you probably launched it manually or a program is calling it repeatedly.
Step 1: Disable PowerShell in Startup Apps
The quickest fix is to check what runs when you log in. Press Ctrl+Shift+Esc to open Task Manager, then go to the Startup tab. Look for any entry named “PowerShell,” “Windows PowerShell,” or something with a script path. If you see one, select it and click Disable.
If you don’t see it there, open the Startup folder by pressing Win+R, typing shell:startup, and pressing Enter. Delete any shortcuts that point to PowerShell. Also check the common startup folder at C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp.
Step 2: Remove Scheduled Tasks That Run PowerShell
Scheduled tasks are the most common cause of PowerShell popping up at random times. To find them:
- Press Win+R, type
taskschd.msc, and press Enter. - In Task Scheduler, look through Task Scheduler Library for tasks whose Actions column says “powershell.exe” or “pwsh.exe”.
- Double-click a suspicious task, go to the Actions tab, and confirm it runs PowerShell.
- If you didn’t create it and it doesn’t belong to a known program, right-click and choose Disable (or Delete if you’re sure).
Be careful: some tasks are created by legitimate software like backup tools or system utilities. Disabling them might break that software. If you’re unsure, search the task name online before deleting.
Step 3: Check for Malware That Uses PowerShell
PowerShell is a favorite tool for malware because it can run scripts without writing files to disk. If you’ve disabled startups and scheduled tasks but PowerShell still pops up, run a full antivirus scan. Windows Security (built into Windows 10 and 11) can do this:
- Open Windows Security from the Start menu.
- Go to Virus & threat protection.
- Click Scan options and choose Full scan.
You can also use the offline scan option, which runs before Windows fully loads and catches stubborn infections. If the pop-up persists after a clean scan, consider a second-opinion scanner from a reputable vendor.
Step 4: Fix File Associations and Shortcut Keys
Sometimes PowerShell opens when you press a certain key combination or when you double-click a file. To rule out keyboard shortcuts:
- Check if any key is stuck (especially the Windows key).
- Open Settings > Devices > Typing and look for “Advanced keyboard settings” to see if any remapping is active.
- If you use a gaming keyboard or mouse with macro software, check its profile for a command that launches PowerShell.
For file associations, right-click a .ps1 file, choose Open with, and make sure it’s set to Notepad or a text editor, not PowerShell. If you accidentally set PowerShell as the default for .txt or .log files, that can cause it to open when you open those files.
Step 5: Use Autoruns for a Deeper Look
If the problem persists, the free Autoruns tool from Microsoft (part of Sysinternals) shows every startup entry, scheduled task, and service in one place. Download it from the official Microsoft website, run it as administrator, and filter by “PowerShell” using the search box. You’ll see exactly what’s triggering it. Disable or delete the entry after confirming it’s not needed.
Autoruns is safe to use, but be careful: it shows everything, including essential Windows components. Only disable entries that clearly reference PowerShell and that you didn’t intentionally create.
Frequently Asked Questions
Why does PowerShell flash and close immediately?
A quick flash usually means a script ran and finished. This is typical of scheduled tasks or startup scripts. Check Task Scheduler and Startup as described above. If it happens every few minutes, look for a task with a repeating trigger.
Is PowerShell popping up a sign of a virus?
Not always, but it can be. Legitimate programs like backup tools or system utilities may use PowerShell silently. However, if you haven’t installed anything new and the pop-up is frequent, run a full antivirus scan to rule out malware.
Can I uninstall PowerShell to stop it?
No. PowerShell is a core Windows component, and removing it can break system functions. Instead, disable the specific triggers as shown above. You can also set the execution policy to restrict scripts, but that may break legitimate software.
Why does PowerShell open when I start my computer?
That’s almost always a startup entry. Check Task Manager’s Startup tab and the two startup folders. If you see a PowerShell command there, disable it. If not, use Autoruns to find hidden entries.
Will disabling PowerShell break Windows?
Disabling the triggers (startup entries, scheduled tasks) won’t break Windows. Disabling PowerShell itself would, but that’s not what these steps do. You’re only stopping specific scripts from running automatically.
What if PowerShell opens after I close it?
If it reopens immediately after closing, a scheduled task with a short repeat interval is likely the cause. Open Task Scheduler, sort by “Next Run Time,” and look for tasks that run every minute or every few minutes. Disable any that reference PowerShell.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Gmail Notifications Not Working? Fixes That Work
- Fix Thumbnails Not Showing on Network Drives in Windows 11
- Stop Skype Auto-Start in Windows: 5 Fixes
- SQL Injection Prevention: Step-by-Step Guide
- Print iMessage or Text Conversations on iPhone & iPad
- Madden 20 Crashes on PC: Solved?