- This topic has 3 replies, 3 voices, and was last updated 3 weeks, 6 days ago by
September 29, 2020 at 11:59 am #259759ParticipantTopics: 11Replies: 8Points: 26Rank: Member
I need to extract the RAM details in a formatted csv file.
I am using this
$memory = (get-Counter -ListSet memory).paths
Get-Counter -Counter $memory -SampleInterval 1
This shows me all the counters.. I need just the basic ones ( the ones that shows on the task manager console – Commit, In Use, pages, Total, Non Paged)
Can someone help me extracting the details in a CSV..
September 29, 2020 at 12:36 pm #259765
September 29, 2020 at 1:07 pm #259780ParticipantTopics: 11Replies: 8Points: 26Rank: Member
I have checked the details from the class but not getting an option of getting the details like Paged Memory, Non Paged Memory, In Use, Commit Memory
I need these in a csv format with appropriate headings.
If you have a script, please share
September 29, 2020 at 4:08 pm #259810Senior ModeratorTopics: 10Replies: 184Points: 980Rank: Major Contributor
If you want information on both physical and virtual memory you’ll have to collect it from multiple places. Virtual memory is a logical device for the operating system (as opposed to a physical device). You can get details on the pagefile from the Win32_PageFileUsage class and use Select-Object to get specific pieces, such as:PowerShell1Get-CimInstance Win32_PageFileUsage | Select-Object CurrentUsage
To get your CSV, you could collect the specific pieces of information that you want, store them in a custom object with the labels that you want, and then use Export-Csv.
- You must be logged in to reply to this topic.