I'm trying to figure out how I can add some text such as MHz or GB to the results in the PowerShell table. Is it possible with a foreach loop?
Get-WmiObject Win32_PhysicalMmory | Format-Table Banklabel, Manufacturer, @{Label="Speed"; Expression={$_.ConfiguredClockSpeed}}, @{Label="Capacity"; Expression={[int64]($_.Capacity/1GB)}} -AutoSize I have another way that comes close, but will not work with multiple results as it doesnt add the informtion into new rows.
$Disk = Get-WmiObject -Class Win32_LogicalDisk $DiskSpace = [int64]($Disk.Size/1GB) $FreeSpace = [INT64]($Disk.FreeSpace/1GB) $UsedSpace = (($DiskSpace-$FreeSpace)/$DiskSpace).ToString("P0") $OBJ = New-Object PSObject $OBJ | Add-Member NoteProperty "ID" ($Disk.DeviceID) $OBJ | Add-Member NoteProperty "Name" ($Disk.VolumeName) $OBJ | Add-Member NoteProperty "Format" ($Disk.FileSystem) $OBJ | Add-Member NoteProperty "Capacity" ("$DiskSpace-GB") $OBJ | Add-Member NoteProperty "Free Space" ("$FreeSpace-GB") $OBJ | Add-Member NoteProperty "Used" ($UsedSpace) Write-Output $OBJ | Format-Table 
