Remove-PSDrive

 

Additional Resources for Remove-PSDrive

 

Unmapping a Windows PowerShell Drive

http://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/remove-psdrive.mspx

 

 

SYNOPSIS

Removes a Windows PowerShell drive from its location.

 

SYNTAX

Remove-PSDrive [-name] <string[]> [-psProvider <string[]>] [-scope <string>] [-force] [-whatIf] [-confirm] [<CommonParameters>]

 

Remove-PSDrive [-literalName] <string[]> [-psProvider <string[]>] [-scope <string>] [-force] [-whatIf] [-confirm] [<CommonParameters>]

 

DETAILED DESCRIPTION

Removes a Windows PowerShell drive from its location. When no drive name is specified, all drives exposed by the specified provider are removed. An error will result if the current working location is a container on a drive you are trying to remove.

 

PARAMETERS

 

-name <string[]>

Specifies the names of the Windows PowerShell drives to remove.

 

Required?

true

Position?

1

Default value

 

Accept pipeline input?  

true (ByPropertyName)

Accept wildcard characters? 

true

 

-psProvider <string[]>

Specifies the names of the Windows PowerShell providers. All drives associated with the provider will be removed.

 

Required?

false

Position?

named

Default value

 

Accept pipeline input?  

true (ByPropertyName)

Accept wildcard characters? 

true

 

-scope <string>

Accepts an index used to identify the scope where the drive will be installed.

 

Required?

false

Position?

named

Default value

String.empty

Accept pipeline input?  

true (ByPropertyName)

Accept wildcard characters? 

false

 

-force <SwitchParameter>

Allows Cmdlet to override restrictions such as renaming existing files as long as security is not compromised.

 

Required?

false

Position?

named

Default value

False

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

-literalName <string[]>

 

Required?

true

Position?

1

Default value

 

Accept pipeline input?  

true (ByPropertyName)

Accept wildcard characters? 

false

 

-whatIf

Describes what would happen if you executed the command without actually executing the command.

 

Required?

false

Position?

named

Default value

 

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

-confirm

Prompts you for confirmation before executing the command.

 

Required?

false

Position?

named

Default value

 

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, type, "get-help about_commonparameters".

 

INPUT TYPE

String

 

RETURN TYPE

None

 

NOTES

 

For more information, type "Get-Help Remove-PSDrive  -detailed". For technical information, type "Get-Help Remove-PSDrive -full".

 

When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".

 

EXAMPLE 1

 

remove-psdrive -name smp

 

This command removes a Windows PowerShell drive named 'smp'.

 

RELATED LINKS

Get-PSDrive

New-PSDrive