Skip to content
This repository was archived by the owner on Nov 7, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions Windows-Samples/Sensors/os_memory_virtual_setting.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Returns the current paging file
# Returns used virutal memory in kilobytes
# Return Type: Integer
# Execution Context: User

$virtualsize = Get-WmiObject Win32_PageFileSetting | where name -EQ "C:\pagefile.sys" | select MaximumSize
if ($virtualsize -ne $null) {
Write-Output $virtualsize
}
else {
Write-Output ""
}
$virtualsize = Get-WmiObject Win32_PageFileSetting | where name -EQ "C:\pagefile.sys"
$size=$virtualsize.maximumsize
write-output $size