forked from bartverdonck/Sitecore-Forms-Extensions
-
Notifications
You must be signed in to change notification settings - Fork 1
/
create-scwpd-nodb.ps1
37 lines (31 loc) · 1.61 KB
/
create-scwpd-nodb.ps1
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
##########################################################################
#
# Usage: manualy extract the parameters.xml file from the original .scwdp.zip file and reference in this file.
# Fill in the packagepath and paramfile path.
#
##########################################################################
$PackagePath = "C:\Projects\Sitecore-Forms-Extensions\downloads\Sitecore 10.1\Sitecore Forms Extensions for SC10.1-4.0.2.scwdp.zip"
$ParamFile = "C:\Temp\parameters.xml"
##########################################################################
$PackageDestinationPath = $($PackagePath).Replace(".scwdp.zip", "-nodb.scwdp.zip")
$msdeploy = "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
$verb = "-verb:sync"
$source = "-source:package=`"$PackagePath`""
$destination = "-dest:package=`"$($PackageDestinationPath)`""
$declareParamFile = "-declareparamfile=`"$($ParamFile)`""
$skipDbFullSQL = "-skip:objectName=dbFullSql"
$skipDbDacFx = "-skip:objectName=dbDacFx"
# read parameter file
[xml]$paramfile_content = Get-Content -Path $ParamFile
$paramfile_paramnames = $paramfile_content.parameters.parameter.name
$params = ""
foreach($paramname in $paramfile_paramnames){
$tmpvalue = "tmpvalue"
if($paramname -eq "License Xml"){ $tmpvalue = "LicenseContent"}
if($paramname -eq "IP Security Client IP"){ $tmpvalue = "0.0.0.0"}
if($paramname -eq "IP Security Client IP Mask"){ $tmpvalue = "0.0.0.0"}
$params = "$params -setParam:`"$paramname`"=`"$tmpvalue`""
}
# create new package
Invoke-Expression "& '$msdeploy' --% $verb $source $destination $declareParamFile $skipDbFullSQL $skipDbDacFx $params"