vagrant-uplift 0.2.1902.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/console +13 -0
- data/bin/setup +8 -0
- data/lib/scripts/vagrant/uplift.vagrant.core/uplift.fix-second-network.ps1 +59 -0
- data/lib/scripts/vagrant/uplift.vagrant.dc12/dc.dsc.ps1 +128 -0
- data/lib/scripts/vagrant/uplift.vagrant.dc12/dc.replica.dsc.ps1 +117 -0
- data/lib/scripts/vagrant/uplift.vagrant.dc12/dc.users.dsc.ps1 +147 -0
- data/lib/scripts/vagrant/uplift.vagrant.dc12/tests/dc.dsc.Tests.ps1 +165 -0
- data/lib/scripts/vagrant/uplift.vagrant.dcjoin/dc.join.dsc.ps1 +125 -0
- data/lib/scripts/vagrant/uplift.vagrant.dcjoin/dc.join.hostname.ps1 +13 -0
- data/lib/scripts/vagrant/uplift.vagrant.dcjoin/tests/dc.join.dsc.Tests.ps1 +12 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/shared/sp.helpers.ps1 +155 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2013.dsc.ps1 +248 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2013.post_setup.dsc.ps1 +117 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.dsc.ps1 +246 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.farm-only.dsc.ps1 +281 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.info.ps1 +36 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.post_setup.dsc.ps1 +125 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.pre_setup1.dsc.ps1 +28 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.pre_setup2.dsc.ps1 +75 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/tests/sp2013.dsc.wfe.Tests.ps1 +68 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/tests/sp2016.dsc.wfe.Tests.ps1 +68 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.complete.dsc.ps1 +186 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.dsc.ps1 +66 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.optimize.dsc.ps1 +50 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.prepare.dsc.ps1 +60 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/tests/sql.dsc.Tests.ps1 +23 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/tests/sql12.dsc.Tests.ps1 +45 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/tests/sql16.dsc.Tests.ps1 +22 -0
- data/lib/scripts/vagrant/uplift.vagrant.visual_studio13/tests/vs13.dsc.Tests.ps1 +61 -0
- data/lib/scripts/vagrant/uplift.vagrant.visual_studio13/vs13.dsc.post_deploy.ps1 +32 -0
- data/lib/scripts/vagrant/uplift.vagrant.visual_studio13/vs13.dsc.ps1 +69 -0
- data/lib/scripts/vagrant/uplift.vagrant.visual_studio17/tests/vs17.dsc.Tests.ps1 +61 -0
- data/lib/scripts/vagrant/uplift.vagrant.visual_studio17/vs17.dsc.post_deploy.ps1 +34 -0
- data/lib/scripts/vagrant/uplift.vagrant.visual_studio17/vs17.dsc.ps1 +134 -0
- data/lib/scripts/vagrant/uplift.vagrant.win12soe/soe.dsc.ps1 +115 -0
- data/lib/scripts/vagrant/uplift.vagrant.win12soe/soe.shortcuts.dsc.ps1 +41 -0
- data/lib/scripts/vagrant/uplift.vagrant.win12soe/tests/soe.dsc.modules.Tests.ps1 +71 -0
- data/lib/scripts/vagrant/uplift.vagrant.win12soe/tests/soe.dsc.os.Tests.ps1 +89 -0
- data/lib/vagrant-uplift.rb +8 -0
- data/lib/vagrant-uplift/config_builder.rb +819 -0
- data/lib/vagrant-uplift/log.rb +146 -0
- data/lib/vagrant-uplift/plugin-vagrant-uplift-checkpoint.rb +41 -0
- data/lib/vagrant-uplift/plugin.rb +16 -0
- data/lib/vagrant-uplift/version.rb +10 -0
- metadata +131 -0
@@ -0,0 +1,50 @@
|
|
1
|
+
# fail on errors and include uplift helpers
|
2
|
+
$ErrorActionPreference = "Stop"
|
3
|
+
|
4
|
+
Import-Module Uplift.Core
|
5
|
+
|
6
|
+
Write-UpliftMessage "Optimizing SQL Server..."
|
7
|
+
Write-UpliftEnv
|
8
|
+
|
9
|
+
Configuration Optimize_SQL
|
10
|
+
{
|
11
|
+
Import-DscResource -ModuleName 'xSQLServer'
|
12
|
+
Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
|
13
|
+
|
14
|
+
Node localhost {
|
15
|
+
|
16
|
+
SqlServerMemory SQLServerMaxMemory
|
17
|
+
{
|
18
|
+
ServerName = $Node.ServerName
|
19
|
+
InstanceName = $Node.InstanceName
|
20
|
+
|
21
|
+
DynamicAlloc = $false
|
22
|
+
|
23
|
+
MinMemory = $Node.MinMemory
|
24
|
+
MaxMemory = $Node.MaxMemory
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
$config = @{
|
30
|
+
AllNodes = @(
|
31
|
+
@{
|
32
|
+
NodeName = 'localhost'
|
33
|
+
PSDscAllowPlainTextPassword = $true
|
34
|
+
|
35
|
+
RetryCount = 10
|
36
|
+
RetryIntervalSec = 30
|
37
|
+
|
38
|
+
ServerName = Get-UpliftEnvVariable "UPLF_SQL_SERVER_NAME" "" (hostname)
|
39
|
+
InstanceName = Get-UpliftEnvVariable "UPLF_SQL_INSTNCE_NAME" "" "MSSQL"
|
40
|
+
|
41
|
+
MinMemory = Get-UpliftEnvVariable "UPLF_SQL_MIN_MEMORY" "" 1024
|
42
|
+
MaxMemory = Get-UpliftEnvVariable "UPLF_SQL_MAX_MEMORY" "" 4096
|
43
|
+
}
|
44
|
+
)
|
45
|
+
}
|
46
|
+
|
47
|
+
$configuration = Get-Command Optimize_SQL
|
48
|
+
Start-UpliftDSCConfiguration $configuration $config
|
49
|
+
|
50
|
+
exit 0
|
@@ -0,0 +1,60 @@
|
|
1
|
+
|
2
|
+
# https://docs.microsoft.com/en-us/sql/database-engine/install-windows/considerations-for-installing-sql-server-using-sysprep?view=sql-server-2017
|
3
|
+
# https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-using-sysprep?view=sql-server-2017
|
4
|
+
# Setup.exe /q /ACTION=PrepareImage l /FEATURES=SQLEngine /InstanceID =<MYINST> /IACCEPTSQLSERVERLICENSETERMS
|
5
|
+
|
6
|
+
# SqlSetup: Add support for sysprepped SQL Server. #2
|
7
|
+
# https://github.com/PowerShell/SqlServerDsc/issues/2#event-1399718765
|
8
|
+
|
9
|
+
# fail on errors and include uplift helpers
|
10
|
+
$ErrorActionPreference = "Stop"
|
11
|
+
|
12
|
+
Import-Module Uplift.Core
|
13
|
+
|
14
|
+
Write-UpliftMessage "Installing SQL Server..."
|
15
|
+
Write-UpliftEnv
|
16
|
+
|
17
|
+
$binSourcePath = Get-UpliftEnvVariable "UPLF_SQL_BIN_PATH"
|
18
|
+
$instanceName = Get-UpliftEnvVariable "UPLF_SQL_INSTANCE_NAME"
|
19
|
+
$instanceFeatures = Get-UpliftEnvVariable "UPLF_SQL_INSTANCE_FEATURES"
|
20
|
+
|
21
|
+
Write-UpliftMessage "Executing prepare DSC..."
|
22
|
+
Configuration Prepare_SQL
|
23
|
+
{
|
24
|
+
Import-DscResource -ModuleName xSQLServer
|
25
|
+
|
26
|
+
Node localhost {
|
27
|
+
|
28
|
+
LocalConfigurationManager
|
29
|
+
{
|
30
|
+
RebootNodeIfNeeded = $false
|
31
|
+
}
|
32
|
+
|
33
|
+
WindowsFeature "NET-Framework-Core"
|
34
|
+
{
|
35
|
+
Ensure="Present"
|
36
|
+
Name = "NET-Framework-Core"
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
$configuration = Get-Command Prepare_SQL
|
42
|
+
Start-UpliftDSCConfiguration $configuration $config
|
43
|
+
|
44
|
+
# Setup.exe /q /ACTION=PrepareImage /FEATURES=SQLEngine /InstanceID =<MYINST> /IACCEPTSQLSERVERLICENSETERMS
|
45
|
+
$execPath = "$binSourcePath/setup.exe"
|
46
|
+
$execArguments = "/qs /ACTION=PrepareImage /FEATURES=$instanceFeatures /InstanceID=$instanceName /IACCEPTSQLSERVERLICENSETERMS"
|
47
|
+
|
48
|
+
Write-UpliftMessage "Executing prepare action..."
|
49
|
+
Write-UpliftMessage " - execPath: $execPath"
|
50
|
+
Write-UpliftMessage " - execArguments: $execArguments"
|
51
|
+
|
52
|
+
$process = Start-Process -FilePath $execPath `
|
53
|
+
-ArgumentList "$execArguments" `
|
54
|
+
-Wait `
|
55
|
+
-PassThru
|
56
|
+
|
57
|
+
$exitCode = $process.ExitCode;
|
58
|
+
Write-Host "Exit code was: $exitCode"
|
59
|
+
|
60
|
+
exit $exitCode
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Describe 'SQL Server minimal configuration' {
|
2
|
+
|
3
|
+
Context "SQL Server" {
|
4
|
+
|
5
|
+
It 'MSSQL service is running' {
|
6
|
+
(get-service MSSQLSERVER).Status | Should BeLike "Running"
|
7
|
+
}
|
8
|
+
|
9
|
+
It 'MSSQL AGENT service is running' {
|
10
|
+
(get-service SQLSERVERAGENT).Status | Should BeLike "Running"
|
11
|
+
}
|
12
|
+
|
13
|
+
}
|
14
|
+
|
15
|
+
Context "SQL Tools" {
|
16
|
+
|
17
|
+
It 'Ssms.exe is installed' {
|
18
|
+
get-command ssms | Should BeLike "*ssms.exe*"
|
19
|
+
}
|
20
|
+
|
21
|
+
}
|
22
|
+
|
23
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# fail on errors and include uplift helpers
|
2
|
+
$ErrorActionPreference = "Stop"
|
3
|
+
|
4
|
+
Import-Module Uplift.Core
|
5
|
+
|
6
|
+
Write-UpliftMessage "Testing SQL Server setup..."
|
7
|
+
Write-UpliftEnv
|
8
|
+
|
9
|
+
$instanceFeatures = Get-UpliftEnvVariable "UPLF_SQL_INSTANCE_FEATURES"
|
10
|
+
|
11
|
+
# such as SQLENGINE,SSMS,ADV_SSMS
|
12
|
+
$instanceFeaturesArray = $instanceFeatures.Split(',')
|
13
|
+
|
14
|
+
$checkSQLEngine = $instanceFeaturesArray.Contains("SQLENGINE") -eq $true
|
15
|
+
$checkSSMS = $instanceFeaturesArray.Contains("SSMS") -eq $true
|
16
|
+
|
17
|
+
Describe 'SQL Server 2012 minimal configuration' {
|
18
|
+
|
19
|
+
# always test SQL server itself
|
20
|
+
Context "SQL Server" {
|
21
|
+
|
22
|
+
It 'MSSQL service is running' {
|
23
|
+
(get-service MSSQLSERVER).Status | Should BeLike "Running"
|
24
|
+
}
|
25
|
+
|
26
|
+
It 'MSSQL AGENT service is running' {
|
27
|
+
(get-service SQLSERVERAGENT).Status | Should BeLike "Running"
|
28
|
+
}
|
29
|
+
|
30
|
+
}
|
31
|
+
|
32
|
+
# only if
|
33
|
+
Context "SQL Tools" {
|
34
|
+
|
35
|
+
It 'ssms.exe is installed' {
|
36
|
+
if($checkSSMS -eq $true) {
|
37
|
+
get-command ssms | Should BeLike "*ssms.exe*"
|
38
|
+
} else {
|
39
|
+
Write-UpliftMessage "Skipping ssms.exe check"
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
}
|
44
|
+
|
45
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Describe 'SQL Server 2016 minimal configuration' {
|
2
|
+
|
3
|
+
Context "SQL Server" {
|
4
|
+
|
5
|
+
It 'MSSQL service is running' {
|
6
|
+
(get-service MSSQLSERVER).Status | Should BeLike "Running"
|
7
|
+
}
|
8
|
+
|
9
|
+
It 'MSSQL AGENT service is running' {
|
10
|
+
(get-service SQLSERVERAGENT).Status | Should BeLike "Running"
|
11
|
+
}
|
12
|
+
|
13
|
+
}
|
14
|
+
|
15
|
+
Context "SQL Tools" {
|
16
|
+
|
17
|
+
It 'ssms.exe is installed' {
|
18
|
+
get-command ssms | Should BeLike "*ssms.exe*"
|
19
|
+
}
|
20
|
+
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# fail on errors and include uplift helpers
|
2
|
+
$ErrorActionPreference = "Stop"
|
3
|
+
|
4
|
+
Import-Module Uplift.Core
|
5
|
+
|
6
|
+
Write-UpliftMessage "Validating Visual Studio install..."
|
7
|
+
Write-UpliftEnv
|
8
|
+
|
9
|
+
$productName = Get-UpliftEnvVariable "UPLF_VS_TEST_PRODUCT_NAME"
|
10
|
+
$officeToolsPackageName = Get-UpliftEnvVariable "UPLF_VS_TEST_OFFICETOOLS_PACKAGE_NAME"
|
11
|
+
|
12
|
+
Describe 'Visual Studio Install' {
|
13
|
+
|
14
|
+
function Get-AppPackage($appName) {
|
15
|
+
|
16
|
+
$result = @()
|
17
|
+
|
18
|
+
$x32 = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* `
|
19
|
+
| Select-Object DisplayName, Name, DisplayVersion, Publisher, InstallDate `
|
20
|
+
| Sort-Object "DisplayName" `
|
21
|
+
| Where-Object { ($null -ne $_.DisplayName) -and $_.DisplayName.Contains($appName) } `
|
22
|
+
|
23
|
+
$x64 = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* `
|
24
|
+
| Select-Object DisplayName, Name, DisplayVersion, Publisher, InstallDate `
|
25
|
+
| Sort-Object "DisplayName" `
|
26
|
+
| Where-Object { ($null -ne $_.DisplayName) -and $_.DisplayName.Contains($appName) } `
|
27
|
+
|
28
|
+
$result += $x32
|
29
|
+
$result += $x64
|
30
|
+
|
31
|
+
return $result
|
32
|
+
}
|
33
|
+
|
34
|
+
function Confirm-AppPackageInstall($appName) {
|
35
|
+
$app = Get-AppPackage $appName
|
36
|
+
|
37
|
+
if($app.Count -gt 1) {
|
38
|
+
# TODO, very nasty :)
|
39
|
+
$app = $app[0]
|
40
|
+
}
|
41
|
+
|
42
|
+
$app.DisplayName | Should BeLike "*$appName*"
|
43
|
+
}
|
44
|
+
|
45
|
+
Context "Visual Studio App" {
|
46
|
+
|
47
|
+
It "$productName" {
|
48
|
+
Confirm-AppPackageInstall($productName)
|
49
|
+
}
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
Context "Visual Studio Plugins" {
|
54
|
+
|
55
|
+
It "$officeToolsPackageName" {
|
56
|
+
Confirm-AppPackageInstall("$officeToolsPackageName")
|
57
|
+
}
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# fail on errors and include uplift helpers
|
2
|
+
$ErrorActionPreference = "Stop"
|
3
|
+
|
4
|
+
Import-Module Uplift.Core
|
5
|
+
|
6
|
+
Write-UpliftMessage "Running Visual Studio post-deploy script..."
|
7
|
+
Write-UpliftEnv
|
8
|
+
|
9
|
+
$productName = Get-UpliftEnvVariable "UPLF_VS_PRODUCT_NAME"
|
10
|
+
|
11
|
+
if ($productName.Contains("2015") -eq $true) {
|
12
|
+
|
13
|
+
Write-UpliftMessage "Detected VS 2015 install. Ensuring additional plugins..."
|
14
|
+
|
15
|
+
# ensuring "choco install -y webpicmd" is here
|
16
|
+
# it should come with APP image but in case we failed or building on old image, install it in the fly
|
17
|
+
Write-UpliftMessage "Ensuring webpicmd install..."
|
18
|
+
choco install -y webpicmd --limit-output --acceptlicense --no-progress
|
19
|
+
Confirm-UpliftExitCode $LASTEXITCODE "Cannot run choco install -y webpicmd"
|
20
|
+
|
21
|
+
Write-UpliftMessage "Installing Office Development tools via webpicmd"
|
22
|
+
# https://github.com/mszcool/devmachinesetup/blob/master/Install-WindowsMachine.ps1
|
23
|
+
webpicmd /Install /Products:OfficeToolsForVS2015 /AcceptEula
|
24
|
+
Confirm-UpliftExitCode $LASTEXITCODE "Cannot install Office Development tools"
|
25
|
+
|
26
|
+
} else {
|
27
|
+
Write-UpliftMessage "No post deploy is needed..."
|
28
|
+
}
|
29
|
+
|
30
|
+
Write-UpliftMessage "Visual Studio post-deploy script completed."
|
31
|
+
|
32
|
+
exit 0;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# fail on errors and include uplift helpers
|
2
|
+
$ErrorActionPreference = "Stop"
|
3
|
+
|
4
|
+
Import-Module Uplift.Core
|
5
|
+
|
6
|
+
Write-UpliftMessage "Installing Visual Studio..."
|
7
|
+
Write-UpliftEnv
|
8
|
+
|
9
|
+
$execPath = Get-UpliftEnvVariable "UPLF_VS_EXECUTABLE_PATH"
|
10
|
+
$productName = Get-UpliftEnvVariable "UPLF_VS_PRODUCT_NAME"
|
11
|
+
$deploymentFilePath = Get-UpliftEnvVariable "UPLF_VS_ADMIN_DEPLOYMENT_FILE_PATH"
|
12
|
+
|
13
|
+
$domainUserName = Get-UpliftEnvVariable "UPLF_VS_DOMAIN_USER_NAME"
|
14
|
+
$domainUserPassword = Get-UpliftEnvVariable "UPLF_VS_DOMAIN_USER_PASSWORD"
|
15
|
+
|
16
|
+
# check if $execPath exists
|
17
|
+
# the reason is that different VS editions have different EXE files:
|
18
|
+
# - vs_ultimate.exe
|
19
|
+
# - vs_enterprise.exe
|
20
|
+
# if not, them look for .exe file at the top folder in $execPath
|
21
|
+
$execPath = Find-UpliftFileInPath $execPath
|
22
|
+
Write-UpliftMessage "Using VS install file: $execPath"
|
23
|
+
|
24
|
+
Configuration Install_VS2013 {
|
25
|
+
|
26
|
+
Import-DSCResource -Name MS_xVisualStudio
|
27
|
+
|
28
|
+
Node localhost {
|
29
|
+
|
30
|
+
$securePassword = ConvertTo-SecureString $Node.DomainUserPassword -AsPlainText -Force
|
31
|
+
$domainUserCreds = New-Object System.Management.Automation.PSCredential($Node.DomainUserName, $securePassword)
|
32
|
+
|
33
|
+
MS_xVisualStudio VistualStudio
|
34
|
+
{
|
35
|
+
Ensure = "Present"
|
36
|
+
PsDscRunAsCredential = $domainUserCreds
|
37
|
+
|
38
|
+
ExecutablePath = $Node.ExecutablePath
|
39
|
+
ProductName = $Node.ProductName
|
40
|
+
AdminDeploymentFile = $Node.AdminDeploymentFile
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
$config = @{
|
46
|
+
AllNodes = @(
|
47
|
+
@{
|
48
|
+
NodeName = 'localhost'
|
49
|
+
|
50
|
+
PSDscAllowDomainUser = $true
|
51
|
+
PSDscAllowPlainTextPassword = $true
|
52
|
+
|
53
|
+
RetryCount = 10
|
54
|
+
RetryIntervalSec = 30
|
55
|
+
|
56
|
+
DomainUserName = $domainUserName
|
57
|
+
DomainUserPassword = $domainUserPassword
|
58
|
+
|
59
|
+
ExecutablePath = $execPath
|
60
|
+
ProductName = $productName
|
61
|
+
AdminDeploymentFile = $deploymentFilePath
|
62
|
+
}
|
63
|
+
)
|
64
|
+
}
|
65
|
+
|
66
|
+
$configuration = Get-Command Install_VS2013
|
67
|
+
Start-UpliftDSCConfiguration $configuration $config
|
68
|
+
|
69
|
+
exit 0
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# fail on errors and include uplift helpers
|
2
|
+
$ErrorActionPreference = "Stop"
|
3
|
+
|
4
|
+
Import-Module Uplift.Core
|
5
|
+
|
6
|
+
Write-UpliftMessage "Validating Visual Studio install..."
|
7
|
+
Write-UpliftEnv
|
8
|
+
|
9
|
+
$productName = Get-UpliftEnvVariable "UPLF_VS_TEST_PRODUCT_NAME"
|
10
|
+
#$officeToolsPackageName = Get-UpliftEnvVariable "UPLF_VS_TEST_OFFICETOOLS_PACKAGE_NAME"
|
11
|
+
|
12
|
+
Describe 'Visual Studio Install' {
|
13
|
+
|
14
|
+
function Get-AppPackage($appName) {
|
15
|
+
|
16
|
+
$result = @()
|
17
|
+
|
18
|
+
$x32 = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* `
|
19
|
+
| Select-Object DisplayName, Name, DisplayVersion, Publisher, InstallDate `
|
20
|
+
| Sort-Object "DisplayName" `
|
21
|
+
| Where-Object { ($null -ne $_.DisplayName) -and $_.DisplayName.Contains($appName) } `
|
22
|
+
|
23
|
+
$x64 = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* `
|
24
|
+
| Select-Object DisplayName, Name, DisplayVersion, Publisher, InstallDate `
|
25
|
+
| Sort-Object "DisplayName" `
|
26
|
+
| Where-Object { ($null -ne $_.DisplayName) -and $_.DisplayName.Contains($appName) } `
|
27
|
+
|
28
|
+
$result += $x32
|
29
|
+
$result += $x64
|
30
|
+
|
31
|
+
return $result
|
32
|
+
}
|
33
|
+
|
34
|
+
function Confirm-AppPackageInstall($appName) {
|
35
|
+
$app = Get-AppPackage $appName
|
36
|
+
|
37
|
+
if($app.Count -gt 1) {
|
38
|
+
# TODO, very nasty :)
|
39
|
+
$app = $app[0]
|
40
|
+
}
|
41
|
+
|
42
|
+
$app.DisplayName | Should BeLike "*$appName*"
|
43
|
+
}
|
44
|
+
|
45
|
+
Context "Visual Studio App" {
|
46
|
+
|
47
|
+
It "$productName" {
|
48
|
+
Confirm-AppPackageInstall($productName)
|
49
|
+
}
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
# Context "Visual Studio Plugins" {
|
54
|
+
|
55
|
+
# It "$officeToolsPackageName" {
|
56
|
+
# Confirm-AppPackageInstall("$officeToolsPackageName")
|
57
|
+
# }
|
58
|
+
|
59
|
+
# }
|
60
|
+
|
61
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# fail on errors and include uplift helpers
|
2
|
+
$ErrorActionPreference = "Stop"
|
3
|
+
|
4
|
+
Import-Module Uplift.Core
|
5
|
+
|
6
|
+
Write-UpliftMessage "Running Visual Studio post-deploy script..."
|
7
|
+
Write-UpliftEnv
|
8
|
+
|
9
|
+
$productName = Get-UpliftEnvVariable "UPLF_VS_PRODUCT_NAME"
|
10
|
+
|
11
|
+
if ($productName.Contains("2015") -eq $true) {
|
12
|
+
|
13
|
+
Write-UpliftMessage "Detected VS 2015 install. Ensuring additional plugins..."
|
14
|
+
|
15
|
+
# ensuring "choco install -y webpicmd" is here
|
16
|
+
# it should come with APP image but in case we failed or building on old image, install it in the fly
|
17
|
+
Write-UpliftMessage "Ensuring webpicmd install..."
|
18
|
+
|
19
|
+
choco install -y webpicmd --limit-output --acceptlicense --no-progress
|
20
|
+
Confirm-UpliftExitCode $LASTEXITCODE "Cannot run choco install -y webpicmd"
|
21
|
+
|
22
|
+
Write-UpliftMessage "Installing Office Development tools via webpicmd"
|
23
|
+
# https://github.com/mszcool/devmachinesetup/blob/master/Install-WindowsMachine.ps1
|
24
|
+
|
25
|
+
webpicmd /Install /Products:OfficeToolsForVS2015 /AcceptEula
|
26
|
+
Confirm-UpliftExitCode $LASTEXITCODE "Cannot install Office Development tools"
|
27
|
+
|
28
|
+
} else {
|
29
|
+
Write-UpliftMessage "No post deploy is needed..."
|
30
|
+
}
|
31
|
+
|
32
|
+
Write-UpliftMessage "Visual Studio post-deploy script completed."
|
33
|
+
|
34
|
+
exit 0
|