CmdID

CmdID / PowerShell / Cmdlets / Remove

Remove-PSDrive

Deletes temporary PowerShell drives and disconnects mapped network drives. PowerShell reference

From the PowerShell reference 8 parameters Alias rdr

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Deletes temporary PowerShell drives and disconnects mapped network drives. The Remove-PSDrive cmdlet deletes temporary PowerShell drives that were created by using the New-PSDrive cmdlet. Beginning in Windows PowerShell 3.0, Remove-PSDrive also disconnects mapped network drives, including, but not limited to, drives created by using the Persist parameter of New-PSDrive. Remove-PSDrive cannot delete Windows physical or logical drives. Beginning in Windows PowerShell 3.0, when an external drive is connected to the computer, PowerShell automatically adds a PSDrive to the file system that represents the new drive. You do not need to restart PowerShell. Similarly, when an external drive is disconnected from the computer, PowerShell automatically deletes the PSDrive that represents the removed drive.

Remove-PSDrive [-Name] <String[]> [-PSProvider <String[]>] [-Scope <String>] [-Force] [-WhatIf] [-Confirm] [-UseTransaction] [<CommonParameters>]
Remove-PSDrive [-LiteralName] <String[]> [-PSProvider <String[]>] [-Scope <String>] [-Force] [-WhatIf] [-Confirm] [-UseTransaction] [<CommonParameters>]

Remove a file system drive

Remove-PSDrive -Name smpIdentify

Remove mapped network drives

Get-PSDrive X, S | Remove-PSDriveIdentify

Its page in the reference: Remove-PSDrive.

Parameters

8 in the PowerShell reference
-ForceRemoves the current PowerShell drive.
-LiteralNameSpecifies the name of the drive. The value of LiteralName is used exactly as typed. No characters are interpreted as wildcards. If the name includes escape characters, enclose it in single quotation marks ('). Single quotation marks instruct PowerShell not to interpret any characters as escape sequences.
-NameSpecifies the names of the drives to remove. Do not type a colon (:) after the drive name.
-PSProviderSpecifies an array of PSProvider objects. This cmdlet removes and disconnects all of the drives associated with the specified PowerShell provider.
-ScopeSpecifies a scope for the drive. The acceptable values for this parameter are: Global, Local, and Script, or a number relative to the current scope. Scopes number 0 through the number of scopes. The current scope number is 0 and its parent is 1. For more information, see about_Scopes.
-UseTransactionIncludes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see about_Transactions.
-ConfirmPrompts you for confirmation before running the cmdlet.
-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.