Skip to content

Commit c589b81

Browse files
authored
Added support for parameter CachingMode (#29)
- Changes to xSmbShare - Added support for parameter CachingMode (issue #8).
1 parent 4c74df4 commit c589b81

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

DscResources/MSFT_xSmbShare/MSFT_xSmbShare.psm1

+10-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ function Get-TargetResource
5353
ConcurrentUserLimit = $smbShare.ConcurrentUserLimit
5454
EncryptData = $smbShare.EncryptData
5555
FolderEnumerationMode = $smbShare.FolderEnumerationMode
56+
CachingMode = $smbShare.CachingMode
5657
ShareState = $smbShare.ShareState
5758
ShareType = $smbShare.ShareType
5859
ShadowCopy = $smbShare.ShadowCopy
@@ -192,6 +193,10 @@ function Set-TargetResource
192193
[System.String]
193194
$FolderEnumerationMode,
194195

196+
[ValidateSet("None","Manual","Programs","Documents","BranchCache")]
197+
[System.String]
198+
$CachingMode,
199+
195200
[System.String[]]
196201
$FullAccess,
197202

@@ -364,6 +369,10 @@ function Test-TargetResource
364369
[System.String]
365370
$FolderEnumerationMode,
366371

372+
[ValidateSet("None","Manual","Programs","Documents","BranchCache")]
373+
[System.String]
374+
$CachingMode,
375+
367376
[System.String[]]
368377
$FullAccess,
369378

@@ -392,7 +401,7 @@ function Test-TargetResource
392401
}
393402
elseif ($share.Ensure -eq "Present")
394403
{
395-
$Params = 'Name', 'Path', 'Description', 'ChangeAccess', 'ConcurrentUserLimit', 'EncryptData', 'FolderEnumerationMode', 'FullAccess', 'NoAccess', 'ReadAccess', 'Ensure'
404+
$Params = 'Name', 'Path', 'Description', 'ChangeAccess', 'ConcurrentUserLimit', 'EncryptData', 'FolderEnumerationMode', 'CachingMode', 'FullAccess', 'NoAccess', 'ReadAccess', 'Ensure'
396405

397406
# Get all matching parameters from alteredBoundParameters that are in Params
398407
$matchingParameters = $alteredBoundParameters.Keys.Where({($_ -in $Params)})

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[];

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ If this parameter is set to 0, then the number of users is unlimited.
2424
The default value is 0.
2525
* **EncryptData**: Indicates that the share is encrypted.
2626
* **FolderEnumerationMode**: Specifies which files and folders in the new SMB share are visible to users.
27+
* **CachingMode**: Specifies the caching mode of the offline files for the SMB share. { 'None' | 'Manual' | 'Programs' | 'Documents' | 'BranchCache' }
2728
* **FullAccess**: Specifies which accounts are granted full permission to access the share.
2829
* **NoAccess**: Specifies which accounts are denied access to the share.
2930
* **ReadAccess**: Specifies which accounts are granted read permission to access the share.
@@ -42,6 +43,9 @@ Admin shares, default shares, IPC$ share are examples.
4243
* Update appveyor.yml to use the default template.
4344
* Added default template files .codecov.yml, .gitattributes, and .gitignore, and
4445
.vscode folder.
46+
* Changes to xSmbShare
47+
* Added support for parameter CachingMode ([issue #8](https://github.com/PowerShell/xSmbShare/issues/8)).
48+
[Martin Vokurek (@MartinVokurek)](https://github.com/MartinVokurek)
4549

4650
### 2.1.0.0
4751

0 commit comments

Comments
 (0)