Reply to Message

View discussion in a popup

Replying to:
prasanna22kumar
Contributor
Contributor

Hi,

Below is changes made for only ( Free Memory & CPU ) as per your instructions,

$time = Get-Date
Get-Cluster -PipelineVariable cluster |
Get-VMHost|
Select @{N='Cluster';E={$cluster.Name}},
    @{N='VMHost';E={$_.Name}},
    @{N='CPU GHz Capacity';E={[math]::Round($_.CpuTotalMhz/1000,2)}},
    @{N='CPU GHz Used';E={[math]::Round($_.CpuUsageMhz/1000,2)}},
    @{N='CPU GHz Free %';E={[math]::Round(($_.CpuTotalMhz - $_.CpuUsageMhz)/1000,2)/100}},
    @{N='Memory Capacity GB';E={[math]::Round($_.MemoryTotalGB,2)}},
    @{N='Memory Used GB';E={[math]::Round($_.MemoryUsageGB,2)}},
    @{N='Memory Free %';E={[math]::Round(($_.MemoryTotalGB - $_.MemoryUsageGB),2)/100}},
    @{N='Timestamp';E={$time}}|
Export-Csv -Path c:\temp\ramdisk\Utilisationreport3.csv -NoTypeInformation -UseCulture

Below is the Ooutput.

CPU GHz CapacityCPU GHz UsedCPU GHz Free %Memory Capacity GBMemory Used GBMemory Free %Timestamp
79.854.760.25041023.65737.622.860304-12-2020 14:20
79.857.710.22091023.65459.155.64504-12-2020 14:20

 

Kindly let me whether OUT is correct, If yes... How I place percentage symbol next to Value as per Below 

CPU GHz CapacityCPU GHz UsedCPU GHz Free %Memory Capacity GBMemory Used GBMemory Free %Timestamp
79.854.760.25%1023.65737.622.86%04-12-2020 14:20
79.857.710.22%1023.65459.155.65%04-12-2020 14:20

 

Thanks,

Kumar

Reply
0 Kudos