Advertisement
henrydenhengst

Get PVS Write Cache In Ram Size

Aug 20th, 2015
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Script        : GetPVSWriteCacheInRamSize.ps1
  2. # Author        : Matthew Nichols - <a href="http://www.mattnics.com">http://www.mattnics.com</a> -twitter - @mattnics
  3. # Creation Date : 16-03-2015
  4. # Usage         : Query the current PVS RAM Cache size - Based on looking at the Pool Non Paged Memory
  5. #
  6.  
  7. # Local computer’s non Pool Non Page Bytes
  8. # Get-PVSRamCache
  9.  
  10. # Remote computer’s uptime with prompt for credential
  11. # Get-PVSRamCache -ComputerName “Server01″ -Credential (Get-Credential)
  12.  
  13. # This function can be used in a pipeline
  14. # “Server01″, “Server02″, “Server03″ | Get-PVSRamCache
  15.  
  16. #*****************************************************************************************************
  17.  
  18. function Get-PVSRamCache
  19. {
  20. [CmdletBinding()]
  21. param (
  22. [Parameter(Position = 0, Mandatory = $false, ValueFromPipeline = $true)]
  23. [Alias(“CN”)]
  24. [String]$ComputerName = $Env:ComputerName,
  25.  
  26. [Parameter(Position = 1, Mandatory = $false)]
  27. [Alias(“RunAs”)]
  28. [System.Management.Automation.Credential()]$Credential = [System.Management.Automation.PSCredential]::Empty
  29. )
  30. process
  31. {
  32. {1}MB -- {0}-f $ComputerName,
  33. [math]::truncate((Get-WmiObject Win32_PerfFormattedData_PerfOS_Memory -ComputerName $ComputerName -Credential $Credential).PoolNonPagedBytes /1MB)
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement