Contact Info

Crumbtrail

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

New-PSDrive - Powershell 1.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

New-PSDrive

Description
Install a new drive on the machine

Usage
New-PSDrive [-name] string -pSProvider string
         [-root] string [-description string] [-scope string]
            [-credential PSCredential] [-whatIf] [-confirm] [CommonParameters]

Options
-name 
       The PowerShell drive name to be added.

   -pSProvider 
       The name of the provider, if omitted you will be prompted.
       e.g. FileSystem, Registry or Certificate. 

   -root string
       The provider internal root or path for the drive being added.

   -description string
       A short description of the drive.

   -scope 
       An index used to identify the scope where the drive will be installed.

   -credential PSCredential
       Use a credential to validate access to the file. Credential represents
       a user-name, such as "User01" or "Domain01\User01", or a PSCredential
       object, such as the one retrieved by using the Get-Credential cmdlet.
       If you type a user name, you will be prompted for a password.

   -whatIf
       Describe what would happen if you executed the command without
       actually executing the command.

   -confirm
       Prompt for confirmation before executing the command.
		
   CommonParameters:

Example(s)
Install a drive called 'SS64' using the file system provider. The drive will be rooted at "C:\MyDocs":

PS C:\>new-Psdrive -name SS64 -psProvider FileSystem -root C:\MyDocs
DIR SS64:

Install a drive called 'S:' using the file system provider. The drive will be rooted at "C:\MyDocs":

PS C:\>new-Psdrive -name S -PsProvider FileSystem -root C:\MyDocs
S:
PS S:\>DIR S:

The parameters are positional, so
PS C:\>New-PSDrive -name M -psprovider FileSystem -root \\Server\Share

is the same as
PS C:\>New-PSDrive M FileSystem \\Server\Share