Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 2.0 » New-PSDrive

New-PSDrive - Powershell 2.0 CmdLet

Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers to control and automate the administration of Windows and applications.

More than hundred command-line tools (so called "cmdlets") can be used to perform system administration tasks and Windows Management Instrumentation (WMI). These cmdlets are easy to use, with standard naming conventions and common parameters, and standard tools for piping, sorting, filtering, and formatting data and objects.

New-PSDrive


Short description
Creates a Windows PowerShell drive in the current session.

Syntax
New-PSDrive [-Name] <string> [-PSProvider] <string> [-Root] <string> [-Credential <PSCredential>] [-Description <st
ring>] [-Scope <string>] [-Confirm] [-WhatIf] [-UseTransaction] [<CommonParameters>]

Description
The New-PSDrive cmdlet creates a Windows PowerShell drive that is "mapped" to or associated with a location in a da
ta store, such as a network drive, a directory on the local computer, or a registry key.

You can use the Windows PowerShell drives that you create to access data in the associated data store, just like yo
u would do with any mapped drive. You can change locations into the drive (using "set-location", "cd", or "chdir") 
and access the contents of the drive (using "get-item", "get-childitem", or "dir").

However, the Windows PowerShell drives are known only to Windows PowerShell. You cannot access them by using Window
s Explorer, Windows Management Instrumentation (WMI), Component Object Model (COM), or the Microsoft .NET Framework
, or by using tools such as Net Use.

 Windows PowerShell drives exist only in the current Windows PowerShell session. To make the drive persistent, you 
can export the session to which you have added the drive, or you can save a New-PSDrive command in your Windows Pow
erShell profile.

To delete a drive that was created by New-PSDrive, use the Remove-PSDrive cmdlet.