/ _ \ \_\(_)/_/ _//"\\_ more on JOHLEM.net / \ 0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0 Disk Management Commands: -------------------------- 1. **Get-Disk** List all disks on the system. Syntax: Get-Disk 2. **Get-Partition** List all partitions on a specific disk. Syntax: Get-Partition -DiskNumber 0 3. **New-Partition** Create a new partition on a disk. Syntax: New-Partition -DiskNumber 0 -Size 10GB -AssignDriveLetter 4. **Format-Volume** Format a partition with a file system. Syntax: Format-Volume -DriveLetter "D" -FileSystem NTFS -NewFileSystemLabel "Data" 5. **Get-Volume** List all volumes (partitions) and their properties. Syntax: Get-Volume 6. **Resize-Partition** Resize an existing partition. Syntax: Resize-Partition -DriveLetter "D" -Size 20GB 7. **Remove-Partition** Delete a partition. Syntax: Remove-Partition -DriveLetter "D" 8. **Set-Partition** Change partition properties, such as making it active. Syntax: Set-Partition -DriveLetter "C" -IsActive $true 9. **Get-PhysicalDisk** Display physical disk information, including health status. Syntax: Get-PhysicalDisk 10. **Initialize-Disk** Initialize a new disk for use (required before creating partitions). Syntax: Initialize-Disk -Number 1 11. **New-Volume** Create a new volume (partition, format, and assign a drive letter). Syntax: New-Volume -DiskNumber 1 -FileSystem NTFS -Size 50GB -DriveLetter "E" -NewFileSystemLabel "NewVolume" 12. **Check-Disk** Run a disk check (chkdsk) on a volume. Syntax: Repair-Volume -DriveLetter "C" -Scan 13. **Repair-Volume** Repair file system errors on a volume. Syntax: Repair-Volume -DriveLetter "C" -OfflineScanAndFix 14. **Optimize-Volume** Optimize a volume by defragmenting or trimming (for SSDs). Syntax: Optimize-Volume -DriveLetter "C" -Defrag 15. **Get-StoragePool** Display storage pool information (used in Storage Spaces). Syntax: Get-StoragePool 16. **New-StoragePool** Create a new storage pool (used in Storage Spaces). Syntax: New-StoragePool -FriendlyName "NewPool" -StorageSubSystemFriendlyName "Storage Spaces" -PhysicalDisks (Get-PhysicalDisk -CanPool $True) 17. **Get-StorageSubsystem** Display storage subsystem information. Syntax: Get-StorageSubsystem 18. **New-VirtualDisk** Create a new virtual disk in a storage pool. Syntax: New-VirtualDisk -StoragePoolFriendlyName "NewPool" -FriendlyName "VirtualDisk1" -Size 100GB -ProvisioningType Thin 19. **Get-Volume** with Filter Filter volumes by specific criteria. Syntax: Get-Volume | Where-Object { $_.FileSystem -eq "NTFS" } 20. **Set-Volume** Modify volume properties, such as the label. Syntax: Set-Volume -DriveLetter "D" -NewFileSystemLabel "NewLabel" +----------------------------------------------------------+ | Note: Disk management commands enable creating, | | formatting, resizing, and managing storage devices| | directly from PowerShell, as well as configuring | | advanced storage features like Storage Spaces. | +----------------------------------------------------------+