Skip to content

Commit 8fc6160

Browse files
committed
Add CachingMode parameter
Adds CachingMode parameter to the Test and Get functions and defines possible values (matches Set-SmbShare). Fixes dsccommunity#8
1 parent 8b1aac0 commit 8fc6160

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

DscResources/MSFT_xSmbShare/MSFT_xSmbShare.psm1

+11-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ function Get-TargetResource
5252
Description = $smbShare.Description
5353
ConcurrentUserLimit = $smbShare.ConcurrentUserLimit
5454
EncryptData = $smbShare.EncryptData
55-
FolderEnumerationMode = $smbShare.FolderEnumerationMode
55+
FolderEnumerationMode = $smbShare.FolderEnumerationMode
56+
CachingMode = $smbShare.CachingMode
5657
ShareState = $smbShare.ShareState
5758
ShareType = $smbShare.ShareType
5859
ShadowCopy = $smbShare.ShadowCopy
@@ -150,6 +151,10 @@ function Set-TargetResource
150151
[System.String]
151152
$FolderEnumerationMode,
152153

154+
[ValidateSet("None","Manual","Programs","Documents","BranchCache")]
155+
[System.String]
156+
$CachingMode,
157+
153158
[System.String[]]
154159
$FullAccess,
155160

@@ -301,6 +306,10 @@ function Test-TargetResource
301306
[System.String]
302307
$FolderEnumerationMode,
303308

309+
[ValidateSet("None","Manual","Programs","Documents","BranchCache")]
310+
[System.String]
311+
$CachingMode,
312+
304313
[System.String[]]
305314
$FullAccess,
306315

@@ -324,7 +333,7 @@ function Test-TargetResource
324333
}
325334
elseif ($share.Ensure -eq "Present")
326335
{
327-
$Params = 'Name', 'Path', 'Description', 'ChangeAccess', 'ConcurrentUserLimit', 'EncryptData', 'FolderEnumerationMode', 'FullAccess', 'NoAccess', 'ReadAccess', 'Ensure'
336+
$Params = 'Name', 'Path', 'Description', 'ChangeAccess', 'ConcurrentUserLimit', 'EncryptData', 'FolderEnumerationMode', 'CachingMode', 'FullAccess', 'NoAccess', 'ReadAccess', 'Ensure'
328337
if ($PSBoundParameters.Keys.Where({$_ -in $Params}) | ForEach-Object {Compare-Object -ReferenceObject $PSBoundParameters.$_ -DifferenceObject $share.$_})
329338
{
330339
$testResult = $false

DscResources/MSFT_xSmbShare/MSFT_xSmbShare.schema.mof

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class MSFT_xSmbShare : OMI_BaseResource
99
[Write, Description("Specifies the maximum number of concurrently connected users that the new SMB share may accommodate. If this parameter is set to zero (0), then the number of users is unlimited. The default value is zero (0).")] Uint32 ConcurrentUserLimit;
1010
[Write, Description("Indicates that the share is encrypted.")] Boolean EncryptData;
1111
[Write, Description("Specifies which files and folders in the new SMB share are visible to users."), ValueMap{"AccessBased","Unrestricted"}, Values{"AccessBased","Unrestricted"}] String FolderEnumerationMode;
12+
[Write, Description("Specifies the caching mode of the offline files for the SMB share."), ValueMap{"None","Manual","Programs","Documents","BranchCache"}, Values{"None","Manual","Programs","Documents","BranchCache"}] String CachingMode;
1213
[Write, Description("Specifies which accounts are granted full permission to access the share.")] String FullAccess[];
1314
[Write, Description("Specifies which accounts are denied access to the share.")] String NoAccess[];
1415
[Write, Description("Specifies which user is granted read permission to access the share.")] String ReadAccess[];

0 commit comments

Comments
 (0)