Contact Info

Crumbtrail » Administration » Powershell » Powershell 1.0 » Remove-PSDrive

Remove-PSDrive - Powershell 1.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.


Remove a provider/drive from its location


-name string[]
       The PowerShell drive name(s), separate multiple names with commas.

   -literalName string[]
       The Drive name which will be used exactly as typed.
       No characters are interpreted as wildcards. If the name includes escape
       characters, enclose it in single quotation marks.

       Remove all of the drives exposed by the specified PowerShell provider.
       e.g. FileSystem, Registry or Certificate.

       The scope within which to search for the specified PowerShell drive.

       Override restrictions that prevent the command from succeeding, apart
       from security settings. e.g. -force will override a files read-only
       attribute, but will not change file permissions.

       Describe what would happen if you executed the command without
       actually executing the command.
       Prompt for confirmation before executing the command.

       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutVariable.

Remove a PowerShell drive named S:

PS C:\>remove-psdrive -name s