Last active
September 19, 2016 11:59
-
-
Save Dan1el42/8448a90332ba4c68b6d4a68a59300dcc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clear-Host | |
$file = Get-Content -Path 'X' # List of Computers | |
$fileName = 'X' + (Get-Date -Format dd.MM.yyyy) + '.HTML' | |
foreach ($node in $file) { | |
$selectObjectProperties = @( | |
'SystemName' | |
'DeviceID' | |
@{ | |
Label = "Total Size" | |
Expression = { $_.Size / 1gb -as [int] } | |
} | |
@{ | |
Label = "Free Size" | |
Expression = { $_.FreeSpace / 1gb -as [int] } | |
} | |
) | |
Get-WmiObject -Class Win32_LogicalDisk -ComputerName $node | | |
Select-Object -Property $selectObjectProperties | ConvertTo-HTML | | |
Out-File -FilePath $filename -Append -NoClobber | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment