So far, we have seen how to use Start-Process to start an application. That involves, in many cases, launching the application and, from the application, opening a file that you want to work on using the application. In this recipe, we will leverage the concept of file association and a proper calling cmdlet to launch an application. In fact, we will go a little further than that.
Invoking an application based on the file type
How to do it...
Download a few images from the web to work with this recipe. They could be anything; just ensure that all of them are of the same file type:
- Navigate to the location where you saved the image files.
- At the prompt, type in the following command to open your image viewer and the files...