-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathInstall-ConfigurationFolder.ps1
More file actions
30 lines (28 loc) · 1.1 KB
/
Install-ConfigurationFolder.ps1
File metadata and controls
30 lines (28 loc) · 1.1 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
<#
.SYNOPSIS
Applies a directory of Sitecore configuration patches to a destination path / web root.
.DESCRIPTION
Applies a directory of Sitecore configuration patches to a destination path / web root. Any .config
files will be copied. The structure of the directory should match the structure of the intended destination in the web root.
.PARAMETER Path
Specifies the path of the target web root.
.PARAMETER ConfigurationPath
Specifies the path of the configuration patch collection.
.EXAMPLE
PS C:\> .\Install-ConfigurationFolder.ps1 -Path 'C:\inetpub\wwwroot' -PatchPath 'C:\tools\dev-patches\CustomErrorsOff'
.INPUTS
None
.OUTPUTS
None
#>
[CmdletBinding()]
Param (
[Parameter(Mandatory = $true)]
[ValidateScript( { Test-Path $_ -PathType Container })]
[string]$Path,
[Parameter(Mandatory = $true)]
[ValidateScript( { Test-Path $_ -PathType Container })]
[string]$PatchPath
)
# We need to iterate children, otherwise Copy-Item includes the folder itself when copying
Get-ChildItem $PatchPath | Copy-Item -Destination $Path -Filter *.config -Recurse -Force -Container