This repository has been archived by the owner on Apr 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTemplateZip.ps1
79 lines (66 loc) · 3.44 KB
/
TemplateZip.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<#
.SYNOPSIS
Zips the MAQS project templates.
.DESCRIPTION
This powershell script is used to zip the MAQS project templates. Editing of parameters in the powershell file may be necessary.
.PARAMETER openSource
Set true if the openSource version of MAQS should be updated
.PARAMETER specSource
Set true if the SpecFlow version of MAQS should be updated
.NOTES
Version: 1.0
Author: Magenic
Creation Date: 05/16/2017
Purpose/Change: Initial script development.
Version: 2.0
Author: Magenic
Creation Date: 07/9/2018
Purpose/Change: Add SpecFlow build support. Add item template support.
Version: 3.0
Author: Magenic
Creation Date: 10/11/2019
Purpose/Change: Remove depracated template.
Version: 4.0
Author: Magenic
Creation Date: 11/6/2021
Purpose/Change: Add SpecFlow templates.
.EXAMPLE
./TemplateUpdates
This command will zip to the open or closed source version of MAQs, depending on which flags are hardcoded to default to true.
.EXAMPLE
./TemplateUpdates -openSource $true
This command will zip the open source templates.
#>
param (
[bool]$openSource = $true,
[bool]$specSource = $true
)
###################################################################################################################
function ZipFiles($inputDirectory, $outputDirectory) {
$nunitDir1 = $inputDirectory + "\NUnit"
$nunitDir2 = $inputDirectory + "\NUnit Only"
Set-Location $inputDirectory
$relativePath = Get-ChildItem $inputDirectory -Directory | Resolve-Path -Relative
ForEach ($file in $relativePath) {
$file = $file.TrimStart(".", " ", "\")
$input = $inputDirectory + "\" + $file
$inputDir = $input + "\*"
$destination = $outputDirectory + "\" + $file + ".zip"
if (($input -ne $nunitDir1) -and ($input -ne $nunitDir2) -and ($input -ne $outputDirectory)) {
Write-Host "Zipping " $input
Compress-Archive -Path $inputDir -DestinationPath $destination -Force
##Copy-Item "C:\Users\TroyW\Desktop\QATBaseTemplate.zip" -Destination $destination -Force
}
}
}
function WorkflowFunction($openSource, $specSource) {
if ($openSource) {
ZipFiles $PSScriptRoot"\Extensions\VisualStudioQatExtensionOss\ProjectTemplates\Magenic SpecFlow Test" $PSScriptRoot"\Extensions\VisualStudioQatExtensionOss\ProjectTemplates\Magenic SpecFlow Test"
ZipFiles $PSScriptRoot"\Extensions\VisualStudioQatExtensionOss\ProjectTemplates\Magenic SpecFlow Test\NUnit" $PSScriptRoot"\Extensions\VisualStudioQatExtensionOss\ProjectTemplates\Magenic SpecFlow Test\NUnit"
ZipFiles $PSScriptRoot"\Extensions\VisualStudioQatExtensionOss\ProjectTemplates\Magenic Test" $PSScriptRoot"\Extensions\VisualStudioQatExtensionOss\ProjectTemplates\Magenic Test"
ZipFiles $PSScriptRoot"\Extensions\VisualStudioQatExtensionOss\ProjectTemplates\Magenic Test Core" $PSScriptRoot"\Extensions\VisualStudioQatExtensionOss\ProjectTemplates\Magenic Test Core"
ZipFiles $PSScriptRoot"\Extensions\VisualStudioQatExtensionOss\ItemTemplates\Magenic Test" $PSScriptRoot"\Extensions\VisualStudioQatExtensionOss\ItemTemplates\Magenic Test"
ZipFiles $PSScriptRoot"\Extensions\VisualStudioQatExtensionOss\ItemTemplates\Magenic SpecFlow Test" $PSScriptRoot"\Extensions\VisualStudioQatExtensionOss\ItemTemplates\Magenic SpecFlow Test"
}
}
WorkflowFunction $openSource $specSource