

In this case, it’s telling us that the parameter can accept an array of strings. The outer square brackets tell us that this command line parameter is optional, but look closer, and you can see that there are two more square brackets attached to the string segment. Before I do that though, let’s take a closer look at line 4 and the syntax used in the MS help page. That’s used to tell PowerShell which files, from all of the files, we would like to include. So, we could for instance ask for all files in the current directory like this: -Path. The -Path is used to specify the location and set of ALL files which could be used in the listing of files.

The bits we need to focus on are lines 2 and 4: -Path and -Include. The trick here is to refer to the documentation. OK - what if we are interested in two types of file extension? Using the same technique as in the Command Shell, just won’t work. That’s fine, but not a huge improvement on the Command Shell. Here, we’re asking PowerShell to show us all files in the current directory (. Starting with the first example, we could use Get-ChildItem. Let’s jump to PowerShell which is significantly better in that regard. That works but the Command Shell isn’t the easiest to work with if you then wanted to process those files in other ways, programmatically. yml at the same time? Back to the shell, you could type this: > dir *.json *.yml You could do something like this: > dir *.jsonīut instead, what if you wanted to look for all. If you wanted to see all the files in a directory that are of type. To begin, let’s look at what you would need to do using the Windows Command Shell. This is a quick tip for people that would like to search for multiple file types in Windows using PowerShell.
