Not only for the original poster of this question, but also for others who may land here to search for answers, the help system is very useful and seems to be often overlooked.
Using the /? or in PowerShell
the get-help
and get-help -full
are useful.
You could probably answer your question by reading the help for the command you wanted to run PowerShell
in this case.
PowerShell[.exe] [-PSConsoleFile <file> | -Version <version>] [-NoLogo] [-NoExit] [-Sta] [-Mta] [-NoProfile] [-NonInteractive] [-InputFormat {Text | XML}] [-OutputFormat {Text | XML}] [-WindowStyle <style>] [-EncodedCommand <Base64EncodedCommand>] [-File <filePath> <args>] [-ExecutionPolicy <ExecutionPolicy>] [-Command { - | <script-block> [-args <arg-array>] | <string> [<CommandParameters>] } ] PowerShell[.exe] -Help | -? | /? -NoExit Does not exit after running startup commands. ... -File Runs the specified script in the local scope ("dot-sourced"), so that the functions and variables that the script creates are available in the current session. Enter the script file path and any parameters. File must be the last parameter in the command, because all characters typed after the File parameter name are interpreted as the script file path followed by the script parameters.
-NoExit - does not start after running start commands.
-File -... The file must be the last parameter in the command ...
source share