Export (0) Print
Expand All
2 out of 3 rated this helpful - Rate this topic

About Windows PowerShell Drives

Published: May 20, 2009

Updated: August 9, 2012

Applies To: Windows PowerShell 2.0, Windows PowerShell 3.0

The concept behind the expanded navigation features in Windows PowerShell is the Windows PowerShell drive.

Windows PowerShell drives can be created in any data store that is available in Windows PowerShell, and they can have any valid name, such as C: or "My Drive", followed by a colon (:). You can navigate in them by using that same methods that you would use in a file system drive. However, the Windows PowerShell drives are visible only in Windows PowerShell. You cannot see them or gain access to them in File Explorer or Cmd.exe.

Windows PowerShell comes with several useful drives which are supported by Windows PowerShell providers. To see a list of Windows PowerShell drives, type:

get-psdrive

You can also create your own Windows PowerShell drives by using the New-PsDrive cmdlet. For example, to create a new drive called "MyDocs:" that is rooted in your My Documents directory, type:

new-psdrive -name MyDocs -psprovider FileSystem -root "$home\My Documents"

You can now use the MyDocs: drive as you would any other drive. You can change your location to it, enumerate its contents, and change its properties.



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.