Hi team,
I have csv file with more than 100 servers it contans the servername,servertype,platform
Server | ServerType | Platform |
test1 | terminalserver | terminal |
test2 | tts | use |
I am trying to get the server which are having 10% less drive space.
$drive = Get-WMIObject -ComputerName $hostname Win32_LogicalDisk | Where-Object {$_.drivetype -eq 3 -and [decimal]$_.size -gt [decimal]$thr} | select __SERVER, DriveType, VolumeName, Name, @{n='Size (Gb)' ;e={"{0:n2}" -f ($_.size/1gb)}},@{n='FreeSpace (Gb)';e={"{0:n2}" -f ($_.freespace/1gb)}}, @{n='PercentFree';e={"{0:n2}" -f ($_.freespace/$_.size*100)}},@{n='Servertype';e={"{0:n2}" -f (Import-Csv .\peer.csv | ? {$_.server -eq "$_.__SERVER"} | select -ExpandProperty"Server Type" )}} | Where-Object {[decimal]$_.PercentFree -lt [decimal]$thresholdspace} | ConvertTo-HTML -fragment
the above command gives me the servers which have less than 10% free space on the drive.
My question is how can i import this csv file and even add the objects like servertype and platform to the output
note - this is a part of a big script which does mulitple thinks. i need the output in html format.