powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Remove-PSDrive



NAME
Remove-PSDrive

SYNOPSIS
Removes a Windows PowerShell drive from its location.

SYNTAX
Remove-PSDrive [-LiteralName] [-Force] [-PSProvider ] [-Scope ] [-Confirm] [-WhatIf] [
-UseTransaction] []

Remove-PSDrive [-Name] [-Force] [-PSProvider ] [-Scope ] [-Confirm] [-WhatIf] [-UseTra
nsaction] []


DESCRIPTION
The Remove-PSDrive cmdlet deletes Windows PowerShell drives that you created by using New-PSDrive.

Remove-PSDrive cannot delete Windows drives or mapped network drives created by using other methods and it cannot d
elete the current working drive.


PARAMETERS
-Force []
Allows the cmdlet to remove the current Windows PowerShell drive.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-LiteralName
Specifies the name of the Windows PowerShell drive.

The value of LiteralName is used exactly as typed. No characters are interpreted as wildcards. If the name incl
udes escape characters, enclose it in single quotation marks ('). Single quotation marks instruct Windows Power
Shell not to interpret any characters as escape sequences.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-Name
Specifies the names of the Windows PowerShell drives to remove. Do not type a colon (:) after the drive name.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-PSProvider
Removes all of the Windows PowerShell drives associated with the specified Windows PowerShell provider.

Required? false
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-Scope
Accepts an index that identifies the scope from which the drive is being removed.

Required? false
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
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

-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

-UseTransaction []
Includes the command in the active transaction. This parameter is valid only when a transaction is in progress.
For more information, see about_Transactions.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false


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

INPUTS
System.Management.Automation.PSDriveInfo
You can pipe a drive object to Remove-PSDrive.


OUTPUTS
None
This cmdlet does not return any output.


NOTES


The Remove-PSDrive cmdlet is designed to work with the data exposed by any provider. To list the providers avai
lable in your session, type "get-psprovider". For more information, see about_Providers.


-------------------------- EXAMPLE 1 --------------------------

C:\PS>remove-psdrive -name smp


Description
-----------
This command removes a Windows PowerShell drive named "smp".






RELATED LINKS
Online version: http://go.microsoft.com/fwlink/?LinkID=113376
about_Providers
Get-PSDrive
New-PSDrive