| 
									
										
										
										
											2023-12-12 16:39:28 +03:00
										 |  |  | function Get-LD { | 
					
						
							|  |  |  |     $LogicalDisk = Get-CimInstance Win32_logicalDisk | Where-Object {$null -ne $_.Size} | Select-Object @{ | 
					
						
							|  |  |  |     Label="Value"; Expression={$_.DeviceID}}, @{Label="AllSize"; Expression={ | 
					
						
							|  |  |  |     ([int]($_.Size/1Gb))}},@{Label="FreeSize"; Expression={ | 
					
						
							|  |  |  |     ([int]($_.FreeSpace/1Gb))}}, @{Label="Free%"; Expression={ | 
					
						
							| 
									
										
										
										
											2023-12-19 00:06:14 +03:00
										 |  |  |     [string]([int]($_.FreeSpace/$_.Size*100))+" %"}},FileSystem,VolumeName | 
					
						
							| 
									
										
										
										
											2023-12-12 16:39:28 +03:00
										 |  |  |     $CollectionLD = New-Object System.Collections.Generic.List[System.Object] | 
					
						
							|  |  |  |     $LogicalDisk | ForEach-Object { | 
					
						
							|  |  |  |         $CollectionLD.Add([PSCustomObject]@{ | 
					
						
							|  |  |  |             Logical_Disk = $_.Value | 
					
						
							| 
									
										
										
										
											2023-12-19 00:06:14 +03:00
										 |  |  |             FileSystem = $_.FileSystem | 
					
						
							|  |  |  |             VolumeName = $_.VolumeName | 
					
						
							|  |  |  |             AllSize    = [string]$_.AllSize+" Gb" | 
					
						
							|  |  |  |             FreeSize   = [string]$_.FreeSize+" Gb" | 
					
						
							|  |  |  |             Free       = $_."Free%" | 
					
						
							| 
									
										
										
										
											2023-12-12 16:39:28 +03:00
										 |  |  |         }) | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     $CollectionLD | 
					
						
							|  |  |  | } |