This repository was archived by the owner on May 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathFileSystemCache.ps1
More file actions
45 lines (37 loc) · 1.46 KB
/
FileSystemCache.ps1
File metadata and controls
45 lines (37 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<#
.Synopsis
Gets the current Windows Cache Manager file system cache sizes and flags.
.DESCRIPTION
Gets the current Windows Cache Manager file system cache sizes and flags.
This cmdlet returns the maximum, minimum and flags used to specify the limits for the
system's file system cache.
.EXAMPLE
Get-FileSystemCache
#>
function Get-FileSystemCache
{
[PSCustomObject]@{MaxFileCacheSize=[PoshInternals.SystemCache]::GetMaxFileCacheSize();MinFileCacheSize=[PoshInternals.SystemCache]::GetMaxFileCacheSize();Flags=[PoshInternals.SystemCache]::GetFlags()}
}
<#
.Synopsis
Set the current Windows Cache Manager file system cache sizes and flags.
.DESCRIPTION
SEt the current Windows Cache Manager file system cache sizes and flags.
This cmdlet sets the maximum, minimum and flags used to specify the limits for the
system's file system cache.
.EXAMPLE
Get-FileSystemCache
#>
function Set-FileSystemCache
{
param(
# The minimum number of bytes that can be stored in the file system cache.
[uint32]$Minimum,
# The maximum number of bytes that can be stored in the file system cache.
[uint32]$Maximum,
# Sets the file system cache flags to enforce hard limits on the minimum and maximum sizes.
[PoshInternals.FileSystemCacheFlags]$Flags
)
Set-Privilege -Privilege "SeIncreaseQuotaPrivilege"
[PoshInternals.SystemCache]::SetCacheFileSize($Minimum, $Maximum, $Flags)
}