In PowerShell, you can run the command directly. An executable program that includes the end of the. com end of. exe, including the end of. bat, the. cmd end of the batch program, and the. PS1 end of the. You can run a program by using the following methods:
< program file name >.< suffix > [parameter list]
Note, however, that the < program file name > In fact refers to a path that can be relative or absolute. When we use the absolute path, we will encounter the path with a space, like the above to execute it, it will be an error.
So, how do you run a command with a space?
The answer is in quotes! Double quotes, single quotes are all available. For example, C:\Program Files\winrar\rar.exe, this is a Winrar with a command-line tool, can be used to compress or extract. rar files, very useful. If we're going to call it in PowerShell, we can use the following methods:
Copy Code code as follows:
& ' C:\Program files\winrar\rar.exe ' < parameter list >
Small series to analyze, first of all, the command with a space in quotation marks. Put the list of parameters outside the program. Then use a program call (&) to make the call. It's so simple!
Well, you can also use this way to invoke a space-delimited command that you want to run.