To restrict the listing to physical drives containing file systems, the search needs to be restricted to file system providers: PS C:\Users\Administrator> Get-PSDrive -psprovider filesystemĪlternatively, the following example demonstrates the use of the. NET System.IO.DriveInfo class, or by accessing the Windows Management Instrumentation (WMI) Win32_LogicalDisk class: PS C:\Users\Administrator> get-psdriveĬlearly, the Get-PSDrive lists all drives in addition to the physical drives on the system (including the virtual drives such as those used to store Windows PowerShell variables and functions). Report this ad Getting Disk Drive InformationĪ listing of drives may be obtained from within Windows PowerShell using either the Get-PSDrive cmdlet, the GetDrive() method of the. The following table lists the key file system related cmdlets together with the alias, cmd and UNIX shell alternatives:ĭescription Clear-Item cli N/A N/A Clears content of a file Copy-Item cpi copy cp Copies file or folder Get-Content gc type cat Gets the content of a file Get-Location gl cd pwd Gets the current directory Move-Item mi move mv Moves file or folder New-Item ni, md N/A N/A Creates file or folder Remove-Item ri del, rd rm, rmdir Deletes file or folder Rename-Item rni, rn ren mv Renames file or folder Set-Content sc N/A N/A Sets file content Set-Item si N/A N/A Sets file content Set-Location sl cd, chdir cd, chdir Sets current directory UNIX/Linux sh command The UNIX/Linux shell equivalent command to help user migrate skills to Windows PowerShell.cmd.exe command - The cmd.exe equivalent command to help users familiar with the Windows Command Prompt migrate to PowerShell.Alias - An preconfigured, abbreviated alias for the cmdlet name such as gl for Get-Location. ![]() Cmdlet name - The standard cmdlet name, such as Get-Location.Each command is accessible in a number of different ways: Windows PowerShell provides a collection of cmdlets specifically for the purposes of interacting with file systems.
0 Comments
Leave a Reply. |