Skip to content

Commit 7357c4b

Browse files
committed
Copied file to vsts folder
1 parent 432e2e7 commit 7357c4b

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

tests/vsts/preparation.ps1

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
Add-AppveyorTest -Name "appveyor.prep" -Framework NUnit -FileName "appveyor.prep.ps1" -Outcome Running
2+
$sw = [system.diagnostics.stopwatch]::startNew()
3+
4+
# Importing constants
5+
$rootPath = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent
6+
. "$rootPath\tests\constants.ps1"
7+
8+
# Get PSScriptAnalyzer (to check warnings)
9+
Write-Host -Object "appveyor.prep: Install PSScriptAnalyzer" -ForegroundColor DarkGreen
10+
Install-Module -Name PSScriptAnalyzer -Force -SkipPublisherCheck | Out-Null
11+
12+
# Get Pester (to run tests)
13+
Write-Host -Object "appveyor.prep: Install Pester" -ForegroundColor DarkGreen
14+
choco install pester | Out-Null
15+
16+
# Get dbatools
17+
Write-Host -Object "appveyor.prep: Install dbatools" -ForegroundColor DarkGreen
18+
Install-Module -Name dbatools | Out-Null
19+
20+
# Get PSFramework
21+
Write-Host -Object "appveyor.prep: Install PSFramework" -ForegroundColor DarkGreen
22+
Install-Module -Name PSFramework | Out-Null
23+
24+
# Get Hyper-V-PowerShell
25+
#Write-Host -Object "appveyor.prep: Install Hyper-V-PowerShell" -ForegroundColor DarkGreen
26+
#Install-WindowsFeature -Name Hyper-V-PowerShell | Out-Null
27+
#Install-WindowsFeature RSAT-Hyper-V-Tools -IncludeAllSubFeature | Out-Null
28+
29+
# Creating config files
30+
Write-Host -Object "appveyor.prep: Creating configurations files" -ForegroundColor DarkGreen
31+
$configPath = "C:\projects\config"
32+
33+
$null = New-Item -Path "$configPath\hosts.json" -Force:$Force
34+
$null = New-Item -Path "$configPath\images.json" -Force:$Force
35+
$null = New-Item -Path "$configPath\clones.json" -Force:$Force
36+
37+
# Creating folder
38+
Write-Host -Object "appveyor.prep: Creating image and clone directories" -ForegroundColor DarkGreen
39+
$imageFolder = "C:\projects\images"
40+
$null = New-Item -Path $imageFolder -ItemType Directory -Force:$Force
41+
42+
$cloneFolder = "C:\projects\clones"
43+
$null = New-Item -Path $cloneFolder -ItemType Directory -Force:$Force
44+
45+
# Setting configurations
46+
Write-Host -Object "appveyor.prep: Setting configurations" -ForegroundColor DarkGreen
47+
Set-PSFConfig -Module PSDatabaseClone -Name setup.status -Value $true -Validation bool
48+
Set-PSFConfig -Module PSDatabaseClone -Name informationstore.mode -Value 'File'
49+
Set-PSFConfig -Module PSDatabaseClone -Name informationstore.path -Value "$configPath" -Validation string
50+
51+
# Registering configurations
52+
Write-Host -Object "appveyor.prep: Registering configurations" -ForegroundColor DarkGreen
53+
Get-PSFConfig -FullName psdatabaseclone.setup.status | Register-PSFConfig -Scope SystemDefault
54+
Get-PSFConfig -FullName psdatabaseclone.informationstore.mode | Register-PSFConfig -Scope SystemDefault
55+
Get-PSFConfig -FullName psdatabaseclone.informationstore.path | Register-PSFConfig -Scope SystemDefault
56+
57+
$sw.Stop()
58+
Update-AppveyorTest -Name "appveyor.prep" -Framework NUnit -FileName "appveyor.prep.ps1" -Outcome Passed -Duration $sw.ElapsedMilliseconds

0 commit comments

Comments
 (0)