From the course: Complete Guide to PowerShell 7

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Navigating the file system provider

Navigating the file system provider - PowerShell Tutorial

From the course: Complete Guide to PowerShell 7

Navigating the file system provider

- [Instructor] Okay, so we're back in PowerShell again inside Visual Studio Code and I've got into the PowerShell console and now we're going to execute things in the bottom just to make life a little bit easier. And what we're going to do first is look at the file system provider. Now, if you remember, we talked about the providers and the file system one is probably one of the easiest ones to utilize. So first thing we're going to do is get the current location. So I'm going to set a variable to the currentDir. So I'm going to right click here and say Run Selection. And then if I say currentDir, it gives me the full path to what I'm working on. What I can then do is utilizing the provider for this, you know, remember we talked about using things like New-Item, Get-ChildItem, et cetera. I can go through and specify a new path. So in this instance it'll be C:\Temp and I'm going to say, "Well, check if this location exists. And if it doesn't, then go ahead and create it and then set…

Contents