From dbb8f9f8c6f6e654ee85e067dcccaad759076161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Both?= Date: Thu, 17 Oct 2019 18:40:02 +0200 Subject: [PATCH] Add example with Force = true --- .../4-SmbShare_RecreateShare_Config.ps1 | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Examples/Resources/SmbShare/4-SmbShare_RecreateShare_Config.ps1 diff --git a/Examples/Resources/SmbShare/4-SmbShare_RecreateShare_Config.ps1 b/Examples/Resources/SmbShare/4-SmbShare_RecreateShare_Config.ps1 new file mode 100644 index 00000000..ad929867 --- /dev/null +++ b/Examples/Resources/SmbShare/4-SmbShare_RecreateShare_Config.ps1 @@ -0,0 +1,44 @@ +<#PSScriptInfo +.VERSION 1.0.0 +.GUID d0847694-6a83-4f5b-bf6f-30cb078033bc +.AUTHOR Microsoft Corporation +.COMPANYNAME Microsoft Corporation +.COPYRIGHT (c) Microsoft Corporation. All rights reserved. +.TAGS DSCConfiguration +.LICENSEURI https://github.com/PowerShell/ComputerManagementDsc/blob/master/LICENSE +.PROJECTURI https://github.com/PowerShell/ComputerManagementDsc +.ICONURI +.EXTERNALMODULEDEPENDENCIES +.REQUIREDSCRIPTS +.EXTERNALSCRIPTDEPENDENCIES +.RELEASENOTES First version. +.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core +#> + +#Requires -module ComputerManagementDsc + +<# + .DESCRIPTION + This example creates an SMB share named 'Share' for the path 'C:\Share1', + using the default values of the cmdlet `New-SmbShare`. If the share + already exists, it will drop the share and recreate it on the new path + because Force is set to true. + + .NOTES + To know the default values, see the documentation for the cmdlet + `New-SmbShare`. +#> +Configuration SmbShare_RecreateShare_Config +{ + Import-DscResource -ModuleName ComputerManagementDsc + + Node localhost + { + SmbShare 'RecreateShare' + { + Name = 'Share' + Path = 'C:\Share1' + Force = $true + } + } +}