How to hide the Powershell window when the PS1 file is running

Anonymous
2023-11-12T04:24:57.1+00:00

I want to make the powershell file run without the powershell window

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,329 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. S.Sengupta 17,311 Reputation points MVP
    2023-11-12T07:05:45.4433333+00:00

    You can use the -WindowStyle hidden parameter with PowerShell.exe command.

    The command will be like this:

    PowerShell.exe -WindowStyle hidden -File "C:\path\to\your\script.ps1"