How do I convert bytes into mb?

Multi tool use
Multi tool use


How do I convert bytes into mb?



In my piped command I want the bytes to be displayed as megabytes. My command queries a list of computers and returns their physical memory.



How do I do the conversion and where do I add it?


$comp = Get-Content c:usersjasonbecomputerlist2.txt
Get-WmiObject -Class Win32_ComputerSystem -computer $comp | select Name, Totalphysicalmemory |`Export-Csv c:usersjasonbePhysical_Mem.csv`




1 Answer
1


$comp = Get-Content c:usersjasonbecomputerlist2.txt
Get-WmiObject -Class Win32_ComputerSystem -computer $comp |
select Name, @{label="Totalphysicalmemory";expression={[int]($_.totalphysicalmemory/1mb)}}|
`Export-Csv c:usersjasonbePhysical_Mem.csv`






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

K2Ib5rf8Q17Cr3oeGBbbp
wBn2oGLLjodbl0URz z bJlGow1NrY2ZLZBld,Hw,ykwYdpqcarNdaUl,1Z,3UYusyp

Popular posts from this blog

PySpark - SparkContext: Error initializing SparkContext File does not exist

django NoReverseMatch Exception

List of Kim Possible characters