Managing the Files and Directories

As mentioned earlier in this chapter, specifically in the section “Providers,” a set of core cmdlets can be used to access and manipulate PowerShell data stores. Because the Windows file system is just another PowerShell data store, it is accessed through the FileSystem provider. Each mounted drive or defined location is represented by a PSDrive and can be managed by using the core cmdlets. Details about how these core cmdlets are used are discussed in the following sections.

Listing Directories of Files

In PowerShell, you can use several cmdlets to explore the file system. The first cmdlet, Get-Location, is used to display the current working location:

PS C:\> get-locationPath----C:\PS C:\>

To get information ...

Get Windows Server® 2012 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.