How it works...

The cmdlet, Start-Process, works with paths. In case of code, though, Linux knows the path where the package is installed. Therefore, simply calling the package by "command" is sufficient.

The VS Code process accepts directory/file location as an input. Therefore, we add the ArgumentList parameter and pass the path to the process as an argument. This opens that directory in VS Code.

Stopping a process requires a .NET object as input by default; Stop-Process would not accept string as the default input. Therefore, we enclose the Get-Process cmdlet within parentheses, so that it gets executed first and outputs a System.Diagnostics.Process object, which is then processed by Stop-Process.

In order to be exact with respect to which process we would like to stop, we use the Process ID, and pass it as the argument to Stop-Process.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.100.42