mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
Another mop up commit to add missing changes from the last mop-up.
This commit is contained in:
@@ -1,83 +1,83 @@
|
||||
function Install-MSI
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$MsiUrl,
|
||||
[String]$MsiName
|
||||
)
|
||||
|
||||
$exitCode = -1
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Downloading $MsiName..."
|
||||
$FilePath = "${env:Temp}\$MsiName"
|
||||
|
||||
Invoke-WebRequest -Uri $MsiUrl -OutFile $FilePath
|
||||
|
||||
$Arguments = ('/i', $FilePath, '/QN', '/norestart' )
|
||||
|
||||
Write-Host "Starting Install $MsiName..."
|
||||
$process = Start-Process -FilePath msiexec.exe -ArgumentList $Arguments -Wait -PassThru
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||
{
|
||||
Write-Host -Object 'Installation successful'
|
||||
return $exitCode
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
|
||||
exit $exitCode
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host -Object "Failed to install the MSI $MsiName"
|
||||
Write-Host -Object $_.Exception.Message
|
||||
exit -1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Install-EXE
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$Url,
|
||||
[String]$Name,
|
||||
[String[]]$ArgumentList
|
||||
)
|
||||
|
||||
$exitCode = -1
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Downloading $Name..."
|
||||
$FilePath = "${env:Temp}\$Name"
|
||||
|
||||
Invoke-WebRequest -Uri $Url -OutFile $FilePath
|
||||
|
||||
Write-Host "Starting Install $Name..."
|
||||
$process = Start-Process -FilePath $FilePath -ArgumentList $ArgumentList -Wait -PassThru
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||
{
|
||||
Write-Host -Object 'Installation successful'
|
||||
return $exitCode
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
|
||||
return $exitCode
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host -Object "Failed to install the Executable $Name"
|
||||
Write-Host -Object $_.Exception.Message
|
||||
return -1
|
||||
}
|
||||
}
|
||||
function Install-MSI
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$MsiUrl,
|
||||
[String]$MsiName
|
||||
)
|
||||
|
||||
$exitCode = -1
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Downloading $MsiName..."
|
||||
$FilePath = "${env:Temp}\$MsiName"
|
||||
|
||||
Invoke-WebRequest -Uri $MsiUrl -OutFile $FilePath
|
||||
|
||||
$Arguments = ('/i', $FilePath, '/QN', '/norestart' )
|
||||
|
||||
Write-Host "Starting Install $MsiName..."
|
||||
$process = Start-Process -FilePath msiexec.exe -ArgumentList $Arguments -Wait -PassThru
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||
{
|
||||
Write-Host -Object 'Installation successful'
|
||||
return $exitCode
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
|
||||
exit $exitCode
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host -Object "Failed to install the MSI $MsiName"
|
||||
Write-Host -Object $_.Exception.Message
|
||||
exit -1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Install-EXE
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$Url,
|
||||
[String]$Name,
|
||||
[String[]]$ArgumentList
|
||||
)
|
||||
|
||||
$exitCode = -1
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Downloading $Name..."
|
||||
$FilePath = "${env:Temp}\$Name"
|
||||
|
||||
Invoke-WebRequest -Uri $Url -OutFile $FilePath
|
||||
|
||||
Write-Host "Starting Install $Name..."
|
||||
$process = Start-Process -FilePath $FilePath -ArgumentList $ArgumentList -Wait -PassThru
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||
{
|
||||
Write-Host -Object 'Installation successful'
|
||||
return $exitCode
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
|
||||
return $exitCode
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host -Object "Failed to install the Executable $Name"
|
||||
Write-Host -Object $_.Exception.Message
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
function Add-ContentToMarkdown {
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
$Content = ""
|
||||
)
|
||||
|
||||
Add-Content 'C:\InstalledSoftware.md' $Content
|
||||
}
|
||||
|
||||
|
||||
function Add-SoftwareDetailsToMarkdown {
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
$SoftwareName = "",
|
||||
$DescriptionMarkdown = ""
|
||||
)
|
||||
|
||||
$Content = @"
|
||||
|
||||
## $SoftwareName
|
||||
|
||||
$DescriptionMarkdown
|
||||
"@
|
||||
Add-ContentToMarkdown -Content $Content
|
||||
}
|
||||
function Add-ContentToMarkdown {
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
$Content = ""
|
||||
)
|
||||
|
||||
Add-Content 'C:\InstalledSoftware.md' $Content
|
||||
}
|
||||
|
||||
|
||||
function Add-SoftwareDetailsToMarkdown {
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
$SoftwareName = "",
|
||||
$DescriptionMarkdown = ""
|
||||
)
|
||||
|
||||
$Content = @"
|
||||
|
||||
## $SoftwareName
|
||||
|
||||
$DescriptionMarkdown
|
||||
"@
|
||||
Add-ContentToMarkdown -Content $Content
|
||||
}
|
||||
|
||||
@@ -1,68 +1,68 @@
|
||||
function Test-MachinePath{
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$PathItem
|
||||
)
|
||||
|
||||
$currentPath = Get-MachinePath
|
||||
|
||||
$pathItems = $currentPath.Split(';')
|
||||
|
||||
if($pathItems.Contains($PathItem))
|
||||
{
|
||||
return $true
|
||||
}
|
||||
else
|
||||
{
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
function Set-MachinePath{
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$NewPath
|
||||
)
|
||||
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name Path -Value $NewPath
|
||||
return $NewPath
|
||||
}
|
||||
|
||||
function Add-MachinePathItem
|
||||
{
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$PathItem
|
||||
)
|
||||
|
||||
$currentPath = Get-MachinePath
|
||||
$newPath = $PathItem + ';' + $currentPath
|
||||
return Set-MachinePath -NewPath $newPath
|
||||
}
|
||||
|
||||
function Get-MachinePath{
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
|
||||
)
|
||||
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
|
||||
return $currentPath
|
||||
}
|
||||
|
||||
function Get-SystemVariable{
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$SystemVariable
|
||||
)
|
||||
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name $SystemVariable).$SystemVariable
|
||||
return $currentPath
|
||||
}
|
||||
|
||||
function Set-SystemVariable{
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$SystemVariable,
|
||||
[string]$Value
|
||||
)
|
||||
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name $SystemVariable -Value $Value
|
||||
return $Value
|
||||
}
|
||||
function Test-MachinePath{
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$PathItem
|
||||
)
|
||||
|
||||
$currentPath = Get-MachinePath
|
||||
|
||||
$pathItems = $currentPath.Split(';')
|
||||
|
||||
if($pathItems.Contains($PathItem))
|
||||
{
|
||||
return $true
|
||||
}
|
||||
else
|
||||
{
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
function Set-MachinePath{
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$NewPath
|
||||
)
|
||||
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name Path -Value $NewPath
|
||||
return $NewPath
|
||||
}
|
||||
|
||||
function Add-MachinePathItem
|
||||
{
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$PathItem
|
||||
)
|
||||
|
||||
$currentPath = Get-MachinePath
|
||||
$newPath = $PathItem + ';' + $currentPath
|
||||
return Set-MachinePath -NewPath $newPath
|
||||
}
|
||||
|
||||
function Get-MachinePath{
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
|
||||
)
|
||||
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
|
||||
return $currentPath
|
||||
}
|
||||
|
||||
function Get-SystemVariable{
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$SystemVariable
|
||||
)
|
||||
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name $SystemVariable).$SystemVariable
|
||||
return $currentPath
|
||||
}
|
||||
|
||||
function Set-SystemVariable{
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$SystemVariable,
|
||||
[string]$Value
|
||||
)
|
||||
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name $SystemVariable -Value $Value
|
||||
return $Value
|
||||
}
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
. $PSScriptRoot\..\PathHelpers.ps1
|
||||
|
||||
Describe 'Test-MachinePath Tests' {
|
||||
Mock Get-MachinePath {return "C:\foo;C:\bar"}
|
||||
It 'Path contains item' {
|
||||
Test-MachinePath -PathItem "C:\foo" | Should Be $true
|
||||
}
|
||||
It 'Path does not containe item' {
|
||||
Test-MachinePath -PathItem "C:\baz" | Should Be $false
|
||||
}
|
||||
}
|
||||
|
||||
Describe 'Set-MachinePath Tests' {
|
||||
Mock Get-MachinePath {return "C:\foo;C:\bar"}
|
||||
Mock Set-ItemProperty {return}
|
||||
It 'Set-MachinePath should return new path' {
|
||||
Set-MachinePath -NewPath "C:\baz" | Should Be "C:\baz"
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Add-MachinePathItem Tests"{
|
||||
Mock Get-MachinePath {return "C:\foo;C:\bar"}
|
||||
Mock Set-ItemProperty {return}
|
||||
It 'Add-MachinePathItem should return complete path' {
|
||||
Add-MachinePathItem -PathItem 'C:\baz' | Should Be 'C:\baz;C:\foo;C:\bar'
|
||||
}
|
||||
}
|
||||
|
||||
Describe 'Set-SystemVariable Tests' {
|
||||
Mock Set-ItemProperty {return}
|
||||
It 'Set-SystemVariable should return new path' {
|
||||
Set-SystemVariable -SystemVariable "NewPathVar" -Value "C:\baz" | Should Be "C:\baz"
|
||||
}
|
||||
}
|
||||
. $PSScriptRoot\..\PathHelpers.ps1
|
||||
|
||||
Describe 'Test-MachinePath Tests' {
|
||||
Mock Get-MachinePath {return "C:\foo;C:\bar"}
|
||||
It 'Path contains item' {
|
||||
Test-MachinePath -PathItem "C:\foo" | Should Be $true
|
||||
}
|
||||
It 'Path does not containe item' {
|
||||
Test-MachinePath -PathItem "C:\baz" | Should Be $false
|
||||
}
|
||||
}
|
||||
|
||||
Describe 'Set-MachinePath Tests' {
|
||||
Mock Get-MachinePath {return "C:\foo;C:\bar"}
|
||||
Mock Set-ItemProperty {return}
|
||||
It 'Set-MachinePath should return new path' {
|
||||
Set-MachinePath -NewPath "C:\baz" | Should Be "C:\baz"
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Add-MachinePathItem Tests"{
|
||||
Mock Get-MachinePath {return "C:\foo;C:\bar"}
|
||||
Mock Set-ItemProperty {return}
|
||||
It 'Add-MachinePathItem should return complete path' {
|
||||
Add-MachinePathItem -PathItem 'C:\baz' | Should Be 'C:\baz;C:\foo;C:\bar'
|
||||
}
|
||||
}
|
||||
|
||||
Describe 'Set-SystemVariable Tests' {
|
||||
Mock Set-ItemProperty {return}
|
||||
It 'Set-SystemVariable should return new path' {
|
||||
Set-SystemVariable -SystemVariable "NewPathVar" -Value "C:\baz" | Should Be "C:\baz"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
################################################################################
|
||||
## File: Download-ToolCache.ps1
|
||||
## Desc: Download tool cache
|
||||
################################################################################
|
||||
|
||||
Function InstallTool
|
||||
{
|
||||
Param
|
||||
(
|
||||
[System.Object]$ExecutablePath
|
||||
)
|
||||
|
||||
Write-Host $ExecutablePath.DirectoryName
|
||||
Set-Location -Path $ExecutablePath.DirectoryName
|
||||
Get-Location | Write-Host
|
||||
if (Test-Path 'tool.zip')
|
||||
{
|
||||
Expand-Archive 'tool.zip' -DestinationPath '.'
|
||||
}
|
||||
cmd.exe /c 'install_to_tools_cache.bat'
|
||||
}
|
||||
|
||||
$SourceUrl = "https://vstsagenttools.blob.core.windows.net/tools"
|
||||
|
||||
$Dest = "C:/"
|
||||
|
||||
$Path = "hostedtoolcache/windows"
|
||||
|
||||
$env:Path = "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy;" + $env:Path
|
||||
|
||||
Write-Host "Started AzCopy from $SourceUrl to $Dest"
|
||||
|
||||
AzCopy /Source:$SourceUrl /Dest:$Dest /S /V /Pattern:$Path
|
||||
|
||||
$ToolsDirectory = $Dest + $Path
|
||||
|
||||
$current = Get-Location
|
||||
Set-Location -Path $ToolsDirectory
|
||||
|
||||
Get-ChildItem -Recurse -Depth 4 -Filter install_to_tools_cache.bat | ForEach-Object {
|
||||
#In order to work correctly Python 3.4 x86 must be installed after x64, this is achieved by current toolcache catalog structure
|
||||
InstallTool($_)
|
||||
}
|
||||
|
||||
Set-Location -Path $current
|
||||
|
||||
setx AGENT_TOOLSDIRECTORY $ToolsDirectory /M
|
||||
|
||||
#junction point from the previous Python2 directory to the toolcache Python2
|
||||
$python2Dir = (Get-Item -Path ($ToolsDirectory + '/Python/2.7*/x64')).FullName
|
||||
cmd.exe /c mklink /d "C:\Python27amd64" "$python2Dir"
|
||||
################################################################################
|
||||
## File: Download-ToolCache.ps1
|
||||
## Desc: Download tool cache
|
||||
################################################################################
|
||||
|
||||
Function InstallTool
|
||||
{
|
||||
Param
|
||||
(
|
||||
[System.Object]$ExecutablePath
|
||||
)
|
||||
|
||||
Write-Host $ExecutablePath.DirectoryName
|
||||
Set-Location -Path $ExecutablePath.DirectoryName
|
||||
Get-Location | Write-Host
|
||||
if (Test-Path 'tool.zip')
|
||||
{
|
||||
Expand-Archive 'tool.zip' -DestinationPath '.'
|
||||
}
|
||||
cmd.exe /c 'install_to_tools_cache.bat'
|
||||
}
|
||||
|
||||
$SourceUrl = "https://vstsagenttools.blob.core.windows.net/tools"
|
||||
|
||||
$Dest = "C:/"
|
||||
|
||||
$Path = "hostedtoolcache/windows"
|
||||
|
||||
$env:Path = "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy;" + $env:Path
|
||||
|
||||
Write-Host "Started AzCopy from $SourceUrl to $Dest"
|
||||
|
||||
AzCopy /Source:$SourceUrl /Dest:$Dest /S /V /Pattern:$Path
|
||||
|
||||
$ToolsDirectory = $Dest + $Path
|
||||
|
||||
$current = Get-Location
|
||||
Set-Location -Path $ToolsDirectory
|
||||
|
||||
Get-ChildItem -Recurse -Depth 4 -Filter install_to_tools_cache.bat | ForEach-Object {
|
||||
#In order to work correctly Python 3.4 x86 must be installed after x64, this is achieved by current toolcache catalog structure
|
||||
InstallTool($_)
|
||||
}
|
||||
|
||||
Set-Location -Path $current
|
||||
|
||||
setx AGENT_TOOLSDIRECTORY $ToolsDirectory /M
|
||||
|
||||
#junction point from the previous Python2 directory to the toolcache Python2
|
||||
$python2Dir = (Get-Item -Path ($ToolsDirectory + '/Python/2.7*/x64')).FullName
|
||||
cmd.exe /c mklink /d "C:\Python27amd64" "$python2Dir"
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
################################################################################
|
||||
## File: Enable-DeveloperMode.ps1
|
||||
## Desc: Enables Developer Mode by toggling registry setting. Developer Mode is required to enable certain tools (e.g. WinAppDriver).
|
||||
################################################################################
|
||||
|
||||
# Create AppModelUnlock if it doesn't exist, required for enabling Developer Mode
|
||||
$RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
|
||||
if (-not(Test-Path -Path $RegistryKeyPath)) {
|
||||
New-Item -Path $RegistryKeyPath -ItemType Directory -Force
|
||||
}
|
||||
|
||||
# Add registry value to enable Developer Mode
|
||||
New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1
|
||||
################################################################################
|
||||
## File: Enable-DeveloperMode.ps1
|
||||
## Desc: Enables Developer Mode by toggling registry setting. Developer Mode is required to enable certain tools (e.g. WinAppDriver).
|
||||
################################################################################
|
||||
|
||||
# Create AppModelUnlock if it doesn't exist, required for enabling Developer Mode
|
||||
$RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
|
||||
if (-not(Test-Path -Path $RegistryKeyPath)) {
|
||||
New-Item -Path $RegistryKeyPath -ItemType Directory -Force
|
||||
}
|
||||
|
||||
# Add registry value to enable Developer Mode
|
||||
New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1
|
||||
|
||||
@@ -1,34 +1,33 @@
|
||||
################################################################################
|
||||
## File: Finalize-VM.ps1
|
||||
## Desc: Clean up folders temp folders after installs to save space
|
||||
################################################################################
|
||||
|
||||
Write-Host "Cleanup WinSxS"
|
||||
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
|
||||
|
||||
$ErrorActionPreference = 'silentlycontinue'
|
||||
|
||||
Write-Host "Clean up various directories"
|
||||
@(
|
||||
"C:\\Recovery",
|
||||
"$env:windir\\logs",
|
||||
"$env:windir\\winsxs\\manifestcache",
|
||||
"$env:windir\\Temp",
|
||||
"$env:windir\\Installer",
|
||||
"$env:TEMP"
|
||||
) | ForEach-Object {
|
||||
if (Test-Path $_) {
|
||||
Write-Host "Removing $_"
|
||||
try {
|
||||
Takeown /d Y /R /f $_
|
||||
Icacls $_ /GRANT:r administrators:F /T /c /q 2>&1 | Out-Null
|
||||
Remove-Item $_ -Recurse -Force | Out-Null
|
||||
}
|
||||
catch { $global:error.RemoveAt(0) }
|
||||
}
|
||||
}
|
||||
|
||||
$winInstallDir = "$env:windir\\Installer"
|
||||
New-Item -Path $winInstallDir -ItemType Directory -Force
|
||||
|
||||
$ErrorActionPreference = 'Continue'
|
||||
################################################################################
|
||||
## File: Finalize-VM.ps1
|
||||
## Desc: Clean up folders temp folders after installs to save space
|
||||
################################################################################
|
||||
|
||||
Write-Host "Cleanup WinSxS"
|
||||
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
|
||||
|
||||
$ErrorActionPreference = 'silentlycontinue'
|
||||
|
||||
Write-Host "Clean up various directories"
|
||||
@(
|
||||
"C:\\Recovery",
|
||||
"$env:windir\\logs",
|
||||
"$env:windir\\winsxs\\manifestcache",
|
||||
"$env:windir\\Temp",
|
||||
"$env:TEMP"
|
||||
) | ForEach-Object {
|
||||
if (Test-Path $_) {
|
||||
Write-Host "Removing $_"
|
||||
try {
|
||||
Takeown /d Y /R /f $_
|
||||
Icacls $_ /GRANT:r administrators:F /T /c /q 2>&1 | Out-Null
|
||||
Remove-Item $_ -Recurse -Force | Out-Null
|
||||
}
|
||||
catch { $global:error.RemoveAt(0) }
|
||||
}
|
||||
}
|
||||
|
||||
$winInstallDir = "$env:windir\\Installer"
|
||||
New-Item -Path $winInstallDir -ItemType Directory -Force
|
||||
|
||||
$ErrorActionPreference = 'Continue'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
## File: Install-7zip.ps1
|
||||
## Desc: Install 7zip
|
||||
################################################################################
|
||||
|
||||
choco install 7zip.install -y
|
||||
################################################################################
|
||||
## File: Install-7zip.ps1
|
||||
## Desc: Install 7zip
|
||||
################################################################################
|
||||
|
||||
choco install 7zip.install -y
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
################################################################################
|
||||
## File: Install-AzureCli.ps1
|
||||
## Desc: Install Azure CLI
|
||||
################################################################################
|
||||
|
||||
choco install azure-cli -y
|
||||
|
||||
$AzureCliExtensionPath = Join-Path $Env:CommonProgramFiles 'AzureCliExtensionDirectory'
|
||||
New-Item -ItemType "directory" -Path $AzureCliExtensionPath
|
||||
|
||||
[Environment]::SetEnvironmentVariable("AZURE_EXTENSION_DIR", $AzureCliExtensionPath, [System.EnvironmentVariableTarget]::Machine)
|
||||
$Env:AZURE_EXTENSION_DIR = $AzureCliExtensionPath
|
||||
################################################################################
|
||||
## File: Install-AzureCli.ps1
|
||||
## Desc: Install Azure CLI
|
||||
################################################################################
|
||||
|
||||
choco install azure-cli -y
|
||||
|
||||
$AzureCliExtensionPath = Join-Path $Env:CommonProgramFiles 'AzureCliExtensionDirectory'
|
||||
New-Item -ItemType "directory" -Path $AzureCliExtensionPath
|
||||
|
||||
[Environment]::SetEnvironmentVariable("AZURE_EXTENSION_DIR", $AzureCliExtensionPath, [System.EnvironmentVariableTarget]::Machine)
|
||||
$Env:AZURE_EXTENSION_DIR = $AzureCliExtensionPath
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
####################################################################################
|
||||
## File: Install-AzureCosmosDbEmulator.ps1
|
||||
## Desc: Install Azure CosmosDb Emulator
|
||||
####################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
Install-MSI -MsiUrl "https://aka.ms/cosmosdb-emulator" -MsiName "AzureCosmosDBEmulator.msi"
|
||||
####################################################################################
|
||||
## File: Install-AzureCosmosDbEmulator.ps1
|
||||
## Desc: Install Azure CosmosDb Emulator
|
||||
####################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
Install-MSI -MsiUrl "https://aka.ms/cosmosdb-emulator" -MsiName "AzureCosmosDBEmulator.msi"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
## File: Install-AzureDevOpsCli.ps1
|
||||
## Desc: Install Azure DevOps CLI
|
||||
################################################################################
|
||||
|
||||
az extension add -n azure-devops
|
||||
################################################################################
|
||||
## File: Install-AzureDevOpsCli.ps1
|
||||
## Desc: Install Azure DevOps CLI
|
||||
################################################################################
|
||||
|
||||
az extension add -n azure-devops
|
||||
|
||||
@@ -1,197 +1,197 @@
|
||||
################################################################################
|
||||
## File: Install-AzureModules.ps1
|
||||
## Desc: Install Azure PowerShell modules
|
||||
################################################################################
|
||||
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
|
||||
function Download-Zip
|
||||
{
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[Parameter(
|
||||
Mandatory = $true
|
||||
)]
|
||||
[string]
|
||||
$BlobUri
|
||||
)
|
||||
|
||||
Write-Host "Downloading the zip from blob: '$BlobUri'"
|
||||
$fileName = "azureps_" + "$(Get-Random)" + ".zip"
|
||||
$targetLocation = Join-Path $ENV:Temp -ChildPath $fileName
|
||||
Write-Host "Download target location: '$targetLocation'"
|
||||
$webClient = New-Object Net.WebClient
|
||||
$null = $webClient.DownloadFileAsync($BlobUri, $targetLocation)
|
||||
while ($webClient.IsBusy) { }
|
||||
Write-Host "Download complete. Target Location: '$targetLocation'"
|
||||
return $targetLocation
|
||||
}
|
||||
|
||||
function Extract-Zip
|
||||
{
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[Parameter(
|
||||
Mandatory = $true
|
||||
)]
|
||||
[string]
|
||||
$ZipFilePath,
|
||||
|
||||
[Parameter(
|
||||
Mandatory = $true
|
||||
)]
|
||||
[string]
|
||||
$TargetLocation
|
||||
)
|
||||
|
||||
Write-Host "Expanding the Zip File: '$ZipFilePath'. Target: '$TargetLocation'"
|
||||
$null = [System.IO.Compression.ZipFile]::ExtractToDirectory($ZipFilePath, $TargetLocation)
|
||||
Write-Host "Extraction completed successfully."
|
||||
}
|
||||
|
||||
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
|
||||
|
||||
# We try to detect the whether Azure PowerShell is installed using .msi file. If it is installed, we find it's version, then it needs to be uninstalled manually (because the uninstallation requires the PowerShell session to be closed)
|
||||
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||
$installedApplications = Get-ItemProperty -Path $regKey
|
||||
$SdkVersion = ($installedApplications | Where-Object { $_.DisplayName -and $_.DisplayName.toLower().Contains("microsoft azure powershell") } | Select-Object -First 1).DisplayVersion
|
||||
|
||||
if($SdkVersion -eq $null)
|
||||
{
|
||||
Write-Host "No .msi Installation Present"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "An Azure PowerShell Installation through installer has been detected. Please close this powershell session and manually uninstall the Azure PowerShell from the Add or Remove Programs in the Control Panel. Then, rerun this script from an Admin PowerShell"
|
||||
throw "An Azure PowerShell Installation through installer has been detected. Please close this powershell session and manually uninstall the Azure PowerShell from the Add or Remove Programs in the Control Panel. Then, rerun this script from an Admin PowerShell"
|
||||
}
|
||||
|
||||
# We will try to uninstall any installation of Azure PowerShell
|
||||
|
||||
$modules = Get-Module -Name Azure -ListAvailable
|
||||
Write-Host "The Azure Modules initially present are:"
|
||||
$modules | Select-Object Name,Version,Path | Format-Table
|
||||
|
||||
foreach($module in $modules)
|
||||
{
|
||||
# add logging for telling what module we are working on now
|
||||
if(Test-Path -LiteralPath $module.Path)
|
||||
{
|
||||
try
|
||||
{
|
||||
Uninstall-Module -Name Azure -RequiredVersion $module.Version.tostring() -Force
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host "The Uninstallation of Azure Module version: $($module.Version.tostring()) failed with the error: $($_.Exception.Message) . Please Check if there isn't any other PowerShell session open."
|
||||
throw $_.Exception.Message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$modules = Get-Module -Name AzureRM -ListAvailable
|
||||
Write-Host "The AzureRM Modules initially present are:"
|
||||
$modules | Select-Object Name,Version,Path | Format-Table
|
||||
|
||||
foreach($module in $modules)
|
||||
{
|
||||
# add logging for telling what module we are working on now
|
||||
if(Test-Path -LiteralPath $module.Path)
|
||||
{
|
||||
try
|
||||
{
|
||||
Uninstall-Module -Name AzureRM -RequiredVersion $module.Version.tostring() -Force
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host "The Uninstallation of AzureRM Module version: $($module.Version.tostring()) failed with the error: $($_.Exception.Message) . Please Check if there isn't any other PowerShell session open."
|
||||
throw $_.Exception.Message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#after this, the only installations available through a Get-Module cmdlet should be nothing
|
||||
|
||||
$modules = Get-Module -Name Azure -ListAvailable
|
||||
|
||||
foreach($module in $modules)
|
||||
{
|
||||
Write-Host "Module found: $($module.Name) Module Version: $($module.Version)"
|
||||
if($module.Version.ToString() -ne " ")
|
||||
{
|
||||
Write-Host "Another installation of Azure module is detected with version $($module.Version.ToString()) at path: $($module.Path)"
|
||||
throw "Azure module uninstallation unsuccessful"
|
||||
}
|
||||
}
|
||||
|
||||
$modules = Get-Module -Name AzureRM -ListAvailable
|
||||
|
||||
foreach($module in $modules)
|
||||
{
|
||||
write-host "Module found: $($module.Name) Module Version: $($module.Version)"
|
||||
if($module.Version.ToString() -ne " ")
|
||||
{
|
||||
Write-Host "Another installation of AzureRM module is detected with version $($module.Version.ToString()) at path: $($module.Path)"
|
||||
throw "AzureRM module uninstallation unsuccessful"
|
||||
}
|
||||
}
|
||||
|
||||
#### NOW The correct Modules need to be saved in C:\Modules
|
||||
|
||||
if($(Test-Path -LiteralPath "C:\Modules") -eq $true)
|
||||
{
|
||||
Write-Host "C:\Modules directory is already present. Beginning to clear it up completely"
|
||||
Remove-Item -Path "C:\Modules" -Recurse -Force
|
||||
}
|
||||
|
||||
mkdir "C:\Modules"
|
||||
|
||||
$directoryListing = Get-ChildItem -Path "C:\Modules"
|
||||
|
||||
if($directoryListing.Length -gt 0)
|
||||
{
|
||||
Write-Host "C:\Modules was not deleted properly. It still has the following contents:"
|
||||
$directoryListing
|
||||
}
|
||||
else {
|
||||
Write-Host "The Directory is clean. There are no contents present in it"
|
||||
}
|
||||
|
||||
# Download and unzip the stored AzurePSModules from the vstsagentools public blob
|
||||
$extractLocation = "C:\Modules"
|
||||
$azurePsUri = @(
|
||||
"https://vstsagenttools.blob.core.windows.net/tools/azurepowershellmodules/AzurePSModules.M157.20190808.27979.zip",
|
||||
"https://vstsagenttools.blob.core.windows.net/tools/azurepowershellmodules/AzureRmPSModules.M157.20190808.27379.zip",
|
||||
"https://vstsagenttools.blob.core.windows.net/tools/azurepowershellmodules/AzPSModules.M163.20191211.17769.zip"
|
||||
)
|
||||
|
||||
$azureRMModulePath = "C:\Modules\azurerm_2.1.0"
|
||||
$azureModulePath = "C:\Modules\azure_2.1.0"
|
||||
$finalPath = ""
|
||||
$environmentPSModulePath = [Environment]::GetEnvironmentVariable("PSModulePath", "Machine")
|
||||
$existingPaths = $environmentPSModulePath -split ';' -replace '\\$',''
|
||||
|
||||
if ($existingPaths -notcontains $azureRMModulePath) {
|
||||
$finalPath = $azureRMModulePath
|
||||
}
|
||||
|
||||
if ($existingPaths -notcontains $azureModulePath) {
|
||||
if($finalPath -ne "") {
|
||||
$finalPath = $finalPath + ";" + $azureModulePath
|
||||
}
|
||||
else {
|
||||
$finalPath = $azureModulePath
|
||||
}
|
||||
}
|
||||
|
||||
if($finalPath -ne "") {
|
||||
[Environment]::SetEnvironmentVariable("PSModulePath", $finalPath + ";" + $env:PSModulePath, "Machine")
|
||||
}
|
||||
|
||||
$env:PSModulePath = $env:PSModulePath.TrimStart(';')
|
||||
|
||||
foreach ($uri in $azurePsUri)
|
||||
{
|
||||
$targetFile = Download-Zip -BlobUri $uri
|
||||
Extract-Zip -ZipFilePath $targetFile -TargetLocation $extractLocation
|
||||
}
|
||||
################################################################################
|
||||
## File: Install-AzureModules.ps1
|
||||
## Desc: Install Azure PowerShell modules
|
||||
################################################################################
|
||||
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
|
||||
function Download-Zip
|
||||
{
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[Parameter(
|
||||
Mandatory = $true
|
||||
)]
|
||||
[string]
|
||||
$BlobUri
|
||||
)
|
||||
|
||||
Write-Host "Downloading the zip from blob: '$BlobUri'"
|
||||
$fileName = "azureps_" + "$(Get-Random)" + ".zip"
|
||||
$targetLocation = Join-Path $ENV:Temp -ChildPath $fileName
|
||||
Write-Host "Download target location: '$targetLocation'"
|
||||
$webClient = New-Object Net.WebClient
|
||||
$null = $webClient.DownloadFileAsync($BlobUri, $targetLocation)
|
||||
while ($webClient.IsBusy) { }
|
||||
Write-Host "Download complete. Target Location: '$targetLocation'"
|
||||
return $targetLocation
|
||||
}
|
||||
|
||||
function Extract-Zip
|
||||
{
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[Parameter(
|
||||
Mandatory = $true
|
||||
)]
|
||||
[string]
|
||||
$ZipFilePath,
|
||||
|
||||
[Parameter(
|
||||
Mandatory = $true
|
||||
)]
|
||||
[string]
|
||||
$TargetLocation
|
||||
)
|
||||
|
||||
Write-Host "Expanding the Zip File: '$ZipFilePath'. Target: '$TargetLocation'"
|
||||
$null = [System.IO.Compression.ZipFile]::ExtractToDirectory($ZipFilePath, $TargetLocation)
|
||||
Write-Host "Extraction completed successfully."
|
||||
}
|
||||
|
||||
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
|
||||
|
||||
# We try to detect the whether Azure PowerShell is installed using .msi file. If it is installed, we find it's version, then it needs to be uninstalled manually (because the uninstallation requires the PowerShell session to be closed)
|
||||
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||
$installedApplications = Get-ItemProperty -Path $regKey
|
||||
$SdkVersion = ($installedApplications | Where-Object { $_.DisplayName -and $_.DisplayName.toLower().Contains("microsoft azure powershell") } | Select-Object -First 1).DisplayVersion
|
||||
|
||||
if($SdkVersion -eq $null)
|
||||
{
|
||||
Write-Host "No .msi Installation Present"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "An Azure PowerShell Installation through installer has been detected. Please close this powershell session and manually uninstall the Azure PowerShell from the Add or Remove Programs in the Control Panel. Then, rerun this script from an Admin PowerShell"
|
||||
throw "An Azure PowerShell Installation through installer has been detected. Please close this powershell session and manually uninstall the Azure PowerShell from the Add or Remove Programs in the Control Panel. Then, rerun this script from an Admin PowerShell"
|
||||
}
|
||||
|
||||
# We will try to uninstall any installation of Azure PowerShell
|
||||
|
||||
$modules = Get-Module -Name Azure -ListAvailable
|
||||
Write-Host "The Azure Modules initially present are:"
|
||||
$modules | Select-Object Name,Version,Path | Format-Table
|
||||
|
||||
foreach($module in $modules)
|
||||
{
|
||||
# add logging for telling what module we are working on now
|
||||
if(Test-Path -LiteralPath $module.Path)
|
||||
{
|
||||
try
|
||||
{
|
||||
Uninstall-Module -Name Azure -RequiredVersion $module.Version.tostring() -Force
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host "The Uninstallation of Azure Module version: $($module.Version.tostring()) failed with the error: $($_.Exception.Message) . Please Check if there isn't any other PowerShell session open."
|
||||
throw $_.Exception.Message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$modules = Get-Module -Name AzureRM -ListAvailable
|
||||
Write-Host "The AzureRM Modules initially present are:"
|
||||
$modules | Select-Object Name,Version,Path | Format-Table
|
||||
|
||||
foreach($module in $modules)
|
||||
{
|
||||
# add logging for telling what module we are working on now
|
||||
if(Test-Path -LiteralPath $module.Path)
|
||||
{
|
||||
try
|
||||
{
|
||||
Uninstall-Module -Name AzureRM -RequiredVersion $module.Version.tostring() -Force
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host "The Uninstallation of AzureRM Module version: $($module.Version.tostring()) failed with the error: $($_.Exception.Message) . Please Check if there isn't any other PowerShell session open."
|
||||
throw $_.Exception.Message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#after this, the only installations available through a Get-Module cmdlet should be nothing
|
||||
|
||||
$modules = Get-Module -Name Azure -ListAvailable
|
||||
|
||||
foreach($module in $modules)
|
||||
{
|
||||
Write-Host "Module found: $($module.Name) Module Version: $($module.Version)"
|
||||
if($module.Version.ToString() -ne " ")
|
||||
{
|
||||
Write-Host "Another installation of Azure module is detected with version $($module.Version.ToString()) at path: $($module.Path)"
|
||||
throw "Azure module uninstallation unsuccessful"
|
||||
}
|
||||
}
|
||||
|
||||
$modules = Get-Module -Name AzureRM -ListAvailable
|
||||
|
||||
foreach($module in $modules)
|
||||
{
|
||||
write-host "Module found: $($module.Name) Module Version: $($module.Version)"
|
||||
if($module.Version.ToString() -ne " ")
|
||||
{
|
||||
Write-Host "Another installation of AzureRM module is detected with version $($module.Version.ToString()) at path: $($module.Path)"
|
||||
throw "AzureRM module uninstallation unsuccessful"
|
||||
}
|
||||
}
|
||||
|
||||
#### NOW The correct Modules need to be saved in C:\Modules
|
||||
|
||||
if($(Test-Path -LiteralPath "C:\Modules") -eq $true)
|
||||
{
|
||||
Write-Host "C:\Modules directory is already present. Beginning to clear it up completely"
|
||||
Remove-Item -Path "C:\Modules" -Recurse -Force
|
||||
}
|
||||
|
||||
mkdir "C:\Modules"
|
||||
|
||||
$directoryListing = Get-ChildItem -Path "C:\Modules"
|
||||
|
||||
if($directoryListing.Length -gt 0)
|
||||
{
|
||||
Write-Host "C:\Modules was not deleted properly. It still has the following contents:"
|
||||
$directoryListing
|
||||
}
|
||||
else {
|
||||
Write-Host "The Directory is clean. There are no contents present in it"
|
||||
}
|
||||
|
||||
# Download and unzip the stored AzurePSModules from the vstsagentools public blob
|
||||
$extractLocation = "C:\Modules"
|
||||
$azurePsUri = @(
|
||||
"https://vstsagenttools.blob.core.windows.net/tools/azurepowershellmodules/AzurePSModules.M157.20190808.27979.zip",
|
||||
"https://vstsagenttools.blob.core.windows.net/tools/azurepowershellmodules/AzureRmPSModules.M157.20190808.27379.zip",
|
||||
"https://vstsagenttools.blob.core.windows.net/tools/azurepowershellmodules/AzPSModules.M163.20191211.17769.zip"
|
||||
)
|
||||
|
||||
$azureRMModulePath = "C:\Modules\azurerm_2.1.0"
|
||||
$azureModulePath = "C:\Modules\azure_2.1.0"
|
||||
$finalPath = ""
|
||||
$environmentPSModulePath = [Environment]::GetEnvironmentVariable("PSModulePath", "Machine")
|
||||
$existingPaths = $environmentPSModulePath -split ';' -replace '\\$',''
|
||||
|
||||
if ($existingPaths -notcontains $azureRMModulePath) {
|
||||
$finalPath = $azureRMModulePath
|
||||
}
|
||||
|
||||
if ($existingPaths -notcontains $azureModulePath) {
|
||||
if($finalPath -ne "") {
|
||||
$finalPath = $finalPath + ";" + $azureModulePath
|
||||
}
|
||||
else {
|
||||
$finalPath = $azureModulePath
|
||||
}
|
||||
}
|
||||
|
||||
if($finalPath -ne "") {
|
||||
[Environment]::SetEnvironmentVariable("PSModulePath", $finalPath + ";" + $env:PSModulePath, "Machine")
|
||||
}
|
||||
|
||||
$env:PSModulePath = $env:PSModulePath.TrimStart(';')
|
||||
|
||||
foreach ($uri in $azurePsUri)
|
||||
{
|
||||
$targetFile = Download-Zip -BlobUri $uri
|
||||
Extract-Zip -ZipFilePath $targetFile -TargetLocation $extractLocation
|
||||
}
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
################################################################################
|
||||
## File: Install-Boost.ps1
|
||||
## Desc: Install boost using tool cache
|
||||
################################################################################
|
||||
|
||||
$ToolCache = 'C:\hostedtoolcache\windows\boost'
|
||||
$BoostDirectory = Join-Path -Path $env:ProgramFiles -ChildPath "Boost"
|
||||
$BoostVersionsToInstall = $env:BOOST_VERSIONS.split(',')
|
||||
$BoostDefault = $env:BOOST_DEFAULT
|
||||
|
||||
foreach($BoostVersion in $BoostVersionsToInstall)
|
||||
{
|
||||
$ZipName = Join-Path -Path $ToolCache -ChildPath "boost_${BoostVersion}_msvc-14.1.zip"
|
||||
|
||||
if (-Not (Test-Path $ZipName))
|
||||
{
|
||||
Write-Host "$ZipName not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Expanding $ZipName"
|
||||
|
||||
$BoostInstallationDir = Join-Path -Path $BoostDirectory -ChildPath $BoostVersion
|
||||
# Expand-Archive slower for 70% than 7z
|
||||
& "$env:ProgramFiles\7-Zip\7z.exe" x $ZipName -o"$BoostDirectory" -y
|
||||
|
||||
$EnvBoostPath = "BOOST_ROOT_{0}" -f ($BoostVersion.Replace('.', '_'))
|
||||
setx $EnvBoostPath $BoostInstallationDir /M | Out-Null
|
||||
|
||||
if ($BoostVersion -eq $BoostDefault)
|
||||
{
|
||||
Write-Host "Adding Boost $BoostVersion to the path..."
|
||||
# Add the Boost binaries to the path
|
||||
Add-MachinePathItem $BoostInstallationDir | Out-Null
|
||||
# Set the BOOSTROOT environment variable
|
||||
setx BOOST_ROOT $BoostInstallationDir /M | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
# Removing boost cache folder
|
||||
Write-Host "Removing boost cache folder"
|
||||
if (Test-Path $ToolCache)
|
||||
{
|
||||
Remove-Item -Path $ToolCache -Force -Recurse
|
||||
}
|
||||
################################################################################
|
||||
## File: Install-Boost.ps1
|
||||
## Desc: Install boost using tool cache
|
||||
################################################################################
|
||||
|
||||
$ToolCache = 'C:\hostedtoolcache\windows\boost'
|
||||
$BoostDirectory = Join-Path -Path $env:ProgramFiles -ChildPath "Boost"
|
||||
$BoostVersionsToInstall = $env:BOOST_VERSIONS.split(',')
|
||||
$BoostDefault = $env:BOOST_DEFAULT
|
||||
|
||||
foreach($BoostVersion in $BoostVersionsToInstall)
|
||||
{
|
||||
$ZipName = Join-Path -Path $ToolCache -ChildPath "boost_${BoostVersion}_msvc-14.1.zip"
|
||||
|
||||
if (-Not (Test-Path $ZipName))
|
||||
{
|
||||
Write-Host "$ZipName not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Expanding $ZipName"
|
||||
|
||||
$BoostInstallationDir = Join-Path -Path $BoostDirectory -ChildPath $BoostVersion
|
||||
# Expand-Archive slower for 70% than 7z
|
||||
& "$env:ProgramFiles\7-Zip\7z.exe" x $ZipName -o"$BoostDirectory" -y
|
||||
|
||||
$EnvBoostPath = "BOOST_ROOT_{0}" -f ($BoostVersion.Replace('.', '_'))
|
||||
setx $EnvBoostPath $BoostInstallationDir /M | Out-Null
|
||||
|
||||
if ($BoostVersion -eq $BoostDefault)
|
||||
{
|
||||
Write-Host "Adding Boost $BoostVersion to the path..."
|
||||
# Add the Boost binaries to the path
|
||||
Add-MachinePathItem $BoostInstallationDir | Out-Null
|
||||
# Set the BOOSTROOT environment variable
|
||||
setx BOOST_ROOT $BoostInstallationDir /M | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
# Removing boost cache folder
|
||||
Write-Host "Removing boost cache folder"
|
||||
if (Test-Path $ToolCache)
|
||||
{
|
||||
Remove-Item -Path $ToolCache -Force -Recurse
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
################################################################################
|
||||
## File: Install-Chrome.ps1
|
||||
## Desc: Install Google Chrome
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$temp_install_dir = 'C:\Windows\Installer'
|
||||
New-Item -Path $temp_install_dir -ItemType Directory -Force
|
||||
|
||||
Install-MSI -MsiUrl "https://seleniumwebdrivers.blob.core.windows.net/knownchromeversion/googlechromestandaloneenterprise64.msi" -MsiName "googlechromestandaloneenterprise64.msi"
|
||||
|
||||
New-NetFirewallRule -DisplayName "BlockGoogleUpdate" -Direction Outbound -Action Block -Program "C:\Program Files (x86)\Google\Update\GoogleUpdate.exe"
|
||||
|
||||
Stop-Service -Name gupdate -Force
|
||||
Set-Service -Name gupdate -StartupType "Disabled"
|
||||
Stop-Service -Name gupdatem -Force
|
||||
Set-Service -Name gupdatem -StartupType "Disabled"
|
||||
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Google\Update" -Force
|
||||
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "AutoUpdateCheckPeriodMinutes" -Value 00000000 -Force
|
||||
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "UpdateDefault" -Value 00000000 -Force
|
||||
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "DisableAutoUpdateChecksCheckboxValue" -Value 00000001 -Force
|
||||
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "Update{8A69D345-D564-463C-AFF1-A69D9E530F96}" -Value 00000000 -Force
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Google\Chrome" -Force
|
||||
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Chrome" -Name "DefaultBrowserSettingEnabled" -Value 00000000 -Force
|
||||
################################################################################
|
||||
## File: Install-Chrome.ps1
|
||||
## Desc: Install Google Chrome
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$temp_install_dir = 'C:\Windows\Installer'
|
||||
New-Item -Path $temp_install_dir -ItemType Directory -Force
|
||||
|
||||
Install-MSI -MsiUrl "https://seleniumwebdrivers.blob.core.windows.net/knownchromeversion/googlechromestandaloneenterprise64.msi" -MsiName "googlechromestandaloneenterprise64.msi"
|
||||
|
||||
New-NetFirewallRule -DisplayName "BlockGoogleUpdate" -Direction Outbound -Action Block -Program "C:\Program Files (x86)\Google\Update\GoogleUpdate.exe"
|
||||
|
||||
Stop-Service -Name gupdate -Force
|
||||
Set-Service -Name gupdate -StartupType "Disabled"
|
||||
Stop-Service -Name gupdatem -Force
|
||||
Set-Service -Name gupdatem -StartupType "Disabled"
|
||||
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Google\Update" -Force
|
||||
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "AutoUpdateCheckPeriodMinutes" -Value 00000000 -Force
|
||||
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "UpdateDefault" -Value 00000000 -Force
|
||||
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "DisableAutoUpdateChecksCheckboxValue" -Value 00000001 -Force
|
||||
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "Update{8A69D345-D564-463C-AFF1-A69D9E530F96}" -Value 00000000 -Force
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Google\Chrome" -Force
|
||||
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Chrome" -Name "DefaultBrowserSettingEnabled" -Value 00000000 -Force
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
################################################################################
|
||||
## File: Install-CloudFoundryCli.ps1
|
||||
## Desc: Install Cloud Foundry CLI
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers
|
||||
|
||||
# Download the latest cf cli exe
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://packages.cloudfoundry.org/stable?release=windows64-exe&source=github" -OutFile cf-cli.zip
|
||||
|
||||
# Create directory for cf cli
|
||||
$cf_cli_path = "C:\cf-cli"
|
||||
New-Item -Path $cf_cli_path -ItemType Directory -Force
|
||||
|
||||
# Extract the zip archive
|
||||
Write-Host "Extracting cf cli..."
|
||||
Expand-Archive -Path cf-cli.zip -DestinationPath $cf_cli_path -Force
|
||||
|
||||
# Add cf to path
|
||||
Add-MachinePathItem $cf_cli_path
|
||||
|
||||
# Delete the cfl-cli zip archive
|
||||
Write-Host "Deleting downloaded archive of cf cli"
|
||||
Remove-Item cf-cli.zip
|
||||
################################################################################
|
||||
## File: Install-CloudFoundryCli.ps1
|
||||
## Desc: Install Cloud Foundry CLI
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers
|
||||
|
||||
# Download the latest cf cli exe
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://packages.cloudfoundry.org/stable?release=windows64-exe&source=github" -OutFile cf-cli.zip
|
||||
|
||||
# Create directory for cf cli
|
||||
$cf_cli_path = "C:\cf-cli"
|
||||
New-Item -Path $cf_cli_path -ItemType Directory -Force
|
||||
|
||||
# Extract the zip archive
|
||||
Write-Host "Extracting cf cli..."
|
||||
Expand-Archive -Path cf-cli.zip -DestinationPath $cf_cli_path -Force
|
||||
|
||||
# Add cf to path
|
||||
Add-MachinePathItem $cf_cli_path
|
||||
|
||||
# Delete the cfl-cli zip archive
|
||||
Write-Host "Deleting downloaded archive of cf cli"
|
||||
Remove-Item cf-cli.zip
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
## File: Install-Cmake.ps1
|
||||
## Desc: Install Cmake
|
||||
################################################################################
|
||||
|
||||
choco install cmake.install -y --installargs 'ADD_CMAKE_TO_PATH=""System""'
|
||||
################################################################################
|
||||
## File: Install-Cmake.ps1
|
||||
## Desc: Install Cmake
|
||||
################################################################################
|
||||
|
||||
choco install cmake.install -y --installargs 'ADD_CMAKE_TO_PATH=""System""'
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
################################################################################
|
||||
## File: Install-ContainersFeature.ps1
|
||||
## Desc: Install Windows container features.
|
||||
## Must be an independent step becuase it requires a machine restart
|
||||
## before we can continue.
|
||||
################################################################################
|
||||
|
||||
Write-Host "Install Containers feature"
|
||||
Install-WindowsFeature -Name Containers
|
||||
|
||||
if ((GWMI Win32_Processor).VirtualizationFirmwareEnabled[0] -and (GWMI Win32_Processor).SecondLevelAddressTranslationExtensions[0]) {
|
||||
Write-Host "Install Hyper-V feature"
|
||||
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools
|
||||
} else {
|
||||
Write-Host "Skipping installation of Hyper-V feature"
|
||||
}
|
||||
################################################################################
|
||||
## File: Install-ContainersFeature.ps1
|
||||
## Desc: Install Windows container features.
|
||||
## Must be an independent step becuase it requires a machine restart
|
||||
## before we can continue.
|
||||
################################################################################
|
||||
|
||||
Write-Host "Install Containers feature"
|
||||
Install-WindowsFeature -Name Containers
|
||||
|
||||
if ((GWMI Win32_Processor).VirtualizationFirmwareEnabled[0] -and (GWMI Win32_Processor).SecondLevelAddressTranslationExtensions[0]) {
|
||||
Write-Host "Install Hyper-V feature"
|
||||
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools
|
||||
} else {
|
||||
Write-Host "Skipping installation of Hyper-V feature"
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
####################################################################################
|
||||
## File: Install-DACFx.ps1
|
||||
## Desc: Install SQL Server® Data-Tier Application Framework (DACFx) for Windows
|
||||
####################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$exitcode = Install-MSI -MsiUrl "https://download.microsoft.com/download/f/1/9/f19eaee6-0728-4a0b-9755-9808acc8af0b/EN/x64/DacFramework.msi" -MsiName "DacFramework.msi"
|
||||
|
||||
exit $exitcode
|
||||
####################################################################################
|
||||
## File: Install-DACFx.ps1
|
||||
## Desc: Install SQL Server® Data-Tier Application Framework (DACFx) for Windows
|
||||
####################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$exitcode = Install-MSI -MsiUrl "https://download.microsoft.com/download/f/1/9/f19eaee6-0728-4a0b-9755-9808acc8af0b/EN/x64/DacFramework.msi" -MsiName "DacFramework.msi"
|
||||
|
||||
exit $exitcode
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
################################################################################
|
||||
## File: Install-Docker.ps1
|
||||
## Desc: Install Docker.
|
||||
## Must be an independent step becuase it requires a restart before we
|
||||
## can continue.
|
||||
################################################################################
|
||||
|
||||
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
|
||||
Write-Host "Install-Module DockerProvider"
|
||||
Install-Module DockerMsftProvider -Force
|
||||
|
||||
Write-Host "Install-Package Docker"
|
||||
Install-Package -Name docker -ProviderName DockerMsftProvider -Force
|
||||
Start-Service docker
|
||||
|
||||
choco install docker-compose -y
|
||||
################################################################################
|
||||
## File: Install-Docker.ps1
|
||||
## Desc: Install Docker.
|
||||
## Must be an independent step becuase it requires a restart before we
|
||||
## can continue.
|
||||
################################################################################
|
||||
|
||||
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
|
||||
Write-Host "Install-Module DockerProvider"
|
||||
Install-Module DockerMsftProvider -Force
|
||||
|
||||
Write-Host "Install-Package Docker"
|
||||
Install-Package -Name docker -ProviderName DockerMsftProvider -Force
|
||||
Start-Service docker
|
||||
|
||||
choco install docker-compose -y
|
||||
|
||||
@@ -1,113 +1,113 @@
|
||||
################################################################################
|
||||
## File: Install-DotnetSDK.ps1
|
||||
## Desc: Install all released versions of the dotnet sdk and populate package
|
||||
## cache. Should run after VS and Node
|
||||
################################################################################
|
||||
|
||||
# ensure temp
|
||||
New-Item -Path C:\Temp -Force -ItemType Directory
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"
|
||||
|
||||
$templates = @(
|
||||
'console',
|
||||
'mstest',
|
||||
'web',
|
||||
'mvc',
|
||||
'webapi'
|
||||
)
|
||||
|
||||
function InstallSDKVersion (
|
||||
$sdkVersion
|
||||
)
|
||||
{
|
||||
if (!(Test-Path -Path "C:\Program Files\dotnet\sdk\$sdkVersion"))
|
||||
{
|
||||
Write-Host "Installing dotnet $sdkVersion"
|
||||
.\dotnet-install.ps1 -Architecture x64 -Version $sdkVersion -InstallDir $(Join-Path -Path $env:ProgramFiles -ChildPath 'dotnet')
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Sdk version $sdkVersion already installed"
|
||||
}
|
||||
|
||||
# Fix for issue 1276. This will be fixed in 3.1.
|
||||
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/dotnet/sdk/82bc30c99f1325dfaa7ad450be96857a4fca2845/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.ImportPublishProfile.targets" -outfile "C:\Program Files\dotnet\sdk\$sdkVersion\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportPublishProfile.targets"
|
||||
|
||||
# warm up dotnet for first time experience
|
||||
$templates | ForEach-Object {
|
||||
$template = $_
|
||||
$projectPath = Join-Path -Path C:\temp -ChildPath $template
|
||||
New-Item -Path $projectPath -Force -ItemType Directory
|
||||
Push-Location -Path $projectPath
|
||||
& $env:ProgramFiles\dotnet\dotnet.exe new globaljson --sdk-version "$sdkVersion"
|
||||
& $env:ProgramFiles\dotnet\dotnet.exe new $template
|
||||
Pop-Location
|
||||
Remove-Item $projectPath -Force -Recurse
|
||||
}
|
||||
}
|
||||
|
||||
function InstallAllValidSdks()
|
||||
{
|
||||
Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases-index.json' -UseBasicParsing -OutFile 'releases-index.json'
|
||||
$dotnetChannels = Get-Content -Path 'releases-index.json' | ConvertFrom-Json
|
||||
|
||||
# Consider all channels except preview/eol channels.
|
||||
# Sort the channels in ascending order
|
||||
$dotnetChannels = $dotnetChannels.'releases-index' | Where-Object { !$_."support-phase".Equals('preview') -and !$_."support-phase".Equals('eol') } | Sort-Object { [Version] $_."channel-version" }
|
||||
|
||||
# Download installation script.
|
||||
Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile 'dotnet-install.ps1'
|
||||
|
||||
ForEach ($dotnetChannel in $dotnetChannels)
|
||||
{
|
||||
$channelVersion = $dotnetChannel.'channel-version';
|
||||
Invoke-WebRequest -Uri $dotnetChannel.'releases.json' -UseBasicParsing -OutFile "releases-$channelVersion.json"
|
||||
$currentReleases = Get-Content -Path "releases-$channelVersion.json" | ConvertFrom-Json
|
||||
# filtering out the preview/rc releases
|
||||
$currentReleases = $currentReleases.'releases' | Where-Object { !$_.'release-version'.Contains('-') } | Sort-Object { [Version] $_.'release-version' }
|
||||
ForEach ($release in $currentReleases)
|
||||
{
|
||||
if ($release.'sdks'.Count -gt 0)
|
||||
{
|
||||
Write-Host 'Found sdks property in release: ' + $release.'release-version' + 'with sdks count: ' + $release.'sdks'.Count
|
||||
|
||||
|
||||
# Remove duplicate entries & preview/rc version from download list
|
||||
# Sort the sdks on version
|
||||
$sdks = @($release.'sdk');
|
||||
$sdks += $release.'sdks' | Where-Object { !$_.'version'.Contains('-') -and !$_.'version'.Equals($release.'sdk'.'version') }
|
||||
$sdks = $sdks | Sort-Object { [Version] $_.'version' }
|
||||
|
||||
ForEach ($sdk in $sdks)
|
||||
{
|
||||
InstallSDKVersion -sdkVersion $sdk.'version'
|
||||
}
|
||||
}
|
||||
elseif (!$release.'sdk'.'version'.Contains('-'))
|
||||
{
|
||||
$sdkVersion = $release.'sdk'.'version'
|
||||
InstallSDKVersion -sdkVersion $sdkVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function RunPostInstallationSteps()
|
||||
{
|
||||
Add-MachinePathItem "C:\Program Files\dotnet"
|
||||
# Run script at startup for all users
|
||||
$cmdDotNetPath = @"
|
||||
@echo off
|
||||
SETX PATH "%USERPROFILE%\.dotnet\tools;%PATH%"
|
||||
"@
|
||||
|
||||
$cmdPath = "C:\Program Files\dotnet\userpath.bat"
|
||||
$cmdDotNetPath | Out-File -Encoding ascii -FilePath $cmdPath
|
||||
|
||||
# Update Run key to run a script at logon
|
||||
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" -Name "DOTNETUSERPATH" -Value $cmdPath
|
||||
}
|
||||
|
||||
InstallAllValidSdks
|
||||
RunPostInstallationSteps
|
||||
################################################################################
|
||||
## File: Install-DotnetSDK.ps1
|
||||
## Desc: Install all released versions of the dotnet sdk and populate package
|
||||
## cache. Should run after VS and Node
|
||||
################################################################################
|
||||
|
||||
# ensure temp
|
||||
New-Item -Path C:\Temp -Force -ItemType Directory
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"
|
||||
|
||||
$templates = @(
|
||||
'console',
|
||||
'mstest',
|
||||
'web',
|
||||
'mvc',
|
||||
'webapi'
|
||||
)
|
||||
|
||||
function InstallSDKVersion (
|
||||
$sdkVersion
|
||||
)
|
||||
{
|
||||
if (!(Test-Path -Path "C:\Program Files\dotnet\sdk\$sdkVersion"))
|
||||
{
|
||||
Write-Host "Installing dotnet $sdkVersion"
|
||||
.\dotnet-install.ps1 -Architecture x64 -Version $sdkVersion -InstallDir $(Join-Path -Path $env:ProgramFiles -ChildPath 'dotnet')
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Sdk version $sdkVersion already installed"
|
||||
}
|
||||
|
||||
# Fix for issue 1276. This will be fixed in 3.1.
|
||||
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/dotnet/sdk/82bc30c99f1325dfaa7ad450be96857a4fca2845/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.ImportPublishProfile.targets" -outfile "C:\Program Files\dotnet\sdk\$sdkVersion\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportPublishProfile.targets"
|
||||
|
||||
# warm up dotnet for first time experience
|
||||
$templates | ForEach-Object {
|
||||
$template = $_
|
||||
$projectPath = Join-Path -Path C:\temp -ChildPath $template
|
||||
New-Item -Path $projectPath -Force -ItemType Directory
|
||||
Push-Location -Path $projectPath
|
||||
& $env:ProgramFiles\dotnet\dotnet.exe new globaljson --sdk-version "$sdkVersion"
|
||||
& $env:ProgramFiles\dotnet\dotnet.exe new $template
|
||||
Pop-Location
|
||||
Remove-Item $projectPath -Force -Recurse
|
||||
}
|
||||
}
|
||||
|
||||
function InstallAllValidSdks()
|
||||
{
|
||||
Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases-index.json' -UseBasicParsing -OutFile 'releases-index.json'
|
||||
$dotnetChannels = Get-Content -Path 'releases-index.json' | ConvertFrom-Json
|
||||
|
||||
# Consider all channels except preview/eol channels.
|
||||
# Sort the channels in ascending order
|
||||
$dotnetChannels = $dotnetChannels.'releases-index' | Where-Object { !$_."support-phase".Equals('preview') -and !$_."support-phase".Equals('eol') } | Sort-Object { [Version] $_."channel-version" }
|
||||
|
||||
# Download installation script.
|
||||
Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile 'dotnet-install.ps1'
|
||||
|
||||
ForEach ($dotnetChannel in $dotnetChannels)
|
||||
{
|
||||
$channelVersion = $dotnetChannel.'channel-version';
|
||||
Invoke-WebRequest -Uri $dotnetChannel.'releases.json' -UseBasicParsing -OutFile "releases-$channelVersion.json"
|
||||
$currentReleases = Get-Content -Path "releases-$channelVersion.json" | ConvertFrom-Json
|
||||
# filtering out the preview/rc releases
|
||||
$currentReleases = $currentReleases.'releases' | Where-Object { !$_.'release-version'.Contains('-') } | Sort-Object { [Version] $_.'release-version' }
|
||||
ForEach ($release in $currentReleases)
|
||||
{
|
||||
if ($release.'sdks'.Count -gt 0)
|
||||
{
|
||||
Write-Host 'Found sdks property in release: ' + $release.'release-version' + 'with sdks count: ' + $release.'sdks'.Count
|
||||
|
||||
|
||||
# Remove duplicate entries & preview/rc version from download list
|
||||
# Sort the sdks on version
|
||||
$sdks = @($release.'sdk');
|
||||
$sdks += $release.'sdks' | Where-Object { !$_.'version'.Contains('-') -and !$_.'version'.Equals($release.'sdk'.'version') }
|
||||
$sdks = $sdks | Sort-Object { [Version] $_.'version' }
|
||||
|
||||
ForEach ($sdk in $sdks)
|
||||
{
|
||||
InstallSDKVersion -sdkVersion $sdk.'version'
|
||||
}
|
||||
}
|
||||
elseif (!$release.'sdk'.'version'.Contains('-'))
|
||||
{
|
||||
$sdkVersion = $release.'sdk'.'version'
|
||||
InstallSDKVersion -sdkVersion $sdkVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function RunPostInstallationSteps()
|
||||
{
|
||||
Add-MachinePathItem "C:\Program Files\dotnet"
|
||||
# Run script at startup for all users
|
||||
$cmdDotNetPath = @"
|
||||
@echo off
|
||||
SETX PATH "%USERPROFILE%\.dotnet\tools;%PATH%"
|
||||
"@
|
||||
|
||||
$cmdPath = "C:\Program Files\dotnet\userpath.bat"
|
||||
$cmdDotNetPath | Out-File -Encoding ascii -FilePath $cmdPath
|
||||
|
||||
# Update Run key to run a script at logon
|
||||
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" -Name "DOTNETUSERPATH" -Value $cmdPath
|
||||
}
|
||||
|
||||
InstallAllValidSdks
|
||||
RunPostInstallationSteps
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
################################################################################
|
||||
## File: Install-Firefox.ps1
|
||||
## Desc: Install Mozilla Firefox
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$temp_install_dir = 'C:\Windows\Installer'
|
||||
New-Item -Path $temp_install_dir -ItemType Directory -Force
|
||||
|
||||
Install-EXE -Url "https://seleniumwebdrivers.blob.core.windows.net/knownfirefoxversion/FirefoxSetup.exe" -Name "FirefoxSetup.exe" -ArgumentList "-ms"
|
||||
|
||||
$path = '{0}\Program Files\Mozilla Firefox\' -f $env:SystemDrive;
|
||||
New-Item -path $path -Name 'mozilla.cfg' -Value '//
|
||||
pref("browser.shell.checkDefaultBrowser", false);
|
||||
pref("app.update.enabled", false);' -ItemType file -force
|
||||
|
||||
$path = '{0}\Program Files\Mozilla Firefox\defaults\pref\' -f $env:SystemDrive;
|
||||
New-Item -path $path -Name 'local-settings.js' -Value 'pref("general.config.obscure_value", 0);
|
||||
pref("general.config.filename", "mozilla.cfg");' -ItemType file -force
|
||||
################################################################################
|
||||
## File: Install-Firefox.ps1
|
||||
## Desc: Install Mozilla Firefox
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$temp_install_dir = 'C:\Windows\Installer'
|
||||
New-Item -Path $temp_install_dir -ItemType Directory -Force
|
||||
|
||||
Install-EXE -Url "https://seleniumwebdrivers.blob.core.windows.net/knownfirefoxversion/FirefoxSetup.exe" -Name "FirefoxSetup.exe" -ArgumentList "-ms"
|
||||
|
||||
$path = '{0}\Program Files\Mozilla Firefox\' -f $env:SystemDrive;
|
||||
New-Item -path $path -Name 'mozilla.cfg' -Value '//
|
||||
pref("browser.shell.checkDefaultBrowser", false);
|
||||
pref("app.update.enabled", false);' -ItemType file -force
|
||||
|
||||
$path = '{0}\Program Files\Mozilla Firefox\defaults\pref\' -f $env:SystemDrive;
|
||||
New-Item -path $path -Name 'local-settings.js' -Value 'pref("general.config.obscure_value", 0);
|
||||
pref("general.config.filename", "mozilla.cfg");' -ItemType file -force
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
################################################################################
|
||||
## File: Install-Git.ps1
|
||||
## Desc: Install Git for Windows
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers
|
||||
|
||||
# Install the latest version of Git which is bundled with Git LFS.
|
||||
# See https://chocolatey.org/packages/git
|
||||
choco install git -y --package-parameters="/GitAndUnixToolsOnPath /WindowsTerminal /NoShellIntegration"
|
||||
|
||||
# Disable GCM machine-wide
|
||||
[Environment]::SetEnvironmentVariable("GCM_INTERACTIVE", "Never", [System.EnvironmentVariableTarget]::Machine)
|
||||
|
||||
Add-MachinePathItem "C:\Program Files\Git\mingw64\bin"
|
||||
Add-MachinePathItem "C:\Program Files\Git\usr\bin"
|
||||
Add-MachinePathItem "C:\Program Files\Git\bin"
|
||||
exit 0
|
||||
################################################################################
|
||||
## File: Install-Git.ps1
|
||||
## Desc: Install Git for Windows
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers
|
||||
|
||||
# Install the latest version of Git which is bundled with Git LFS.
|
||||
# See https://chocolatey.org/packages/git
|
||||
choco install git -y --package-parameters="/GitAndUnixToolsOnPath /WindowsTerminal /NoShellIntegration"
|
||||
|
||||
# Disable GCM machine-wide
|
||||
[Environment]::SetEnvironmentVariable("GCM_INTERACTIVE", "Never", [System.EnvironmentVariableTarget]::Machine)
|
||||
|
||||
Add-MachinePathItem "C:\Program Files\Git\mingw64\bin"
|
||||
Add-MachinePathItem "C:\Program Files\Git\usr\bin"
|
||||
Add-MachinePathItem "C:\Program Files\Git\bin"
|
||||
exit 0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
## File: Install-GitVersion.ps1
|
||||
## Desc: Install GitVersion
|
||||
################################################################################
|
||||
|
||||
choco install gitversion.portable -y
|
||||
################################################################################
|
||||
## File: Install-GitVersion.ps1
|
||||
## Desc: Install GitVersion
|
||||
################################################################################
|
||||
|
||||
choco install gitversion.portable -y
|
||||
|
||||
@@ -1,71 +1,71 @@
|
||||
################################################################################
|
||||
## File: Install-Go.ps1
|
||||
## Desc: Install Go
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
function Install-GoVersion
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$goVersion,
|
||||
[Switch]$addToDefaultPath
|
||||
)
|
||||
|
||||
# Download the Go zip archive.
|
||||
Write-Host "Downloading Go $goVersion..."
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://dl.google.com/go/go$goVersion.windows-amd64.zip" -OutFile go$goVersion.windows-amd64.zip
|
||||
|
||||
# Extract the zip archive. It contains a single directory named "go".
|
||||
Write-Host "Extracting Go $goVersion..."
|
||||
Expand-Archive -Path go$goVersion.windows-amd64.zip -DestinationPath "C:\" -Force
|
||||
|
||||
# Delete unnecessary files to conserve space
|
||||
Write-Host "Cleaning directories of Go $goVersion..."
|
||||
if (Test-Path "C:\go\doc")
|
||||
{
|
||||
Remove-Item -Recurse -Force "C:\go\doc"
|
||||
}
|
||||
if (Test-Path "C:\go\blog")
|
||||
{
|
||||
Remove-Item -Recurse -Force "C:\go\blog"
|
||||
}
|
||||
|
||||
# Rename the extracted "go" directory to include the Go version number (to support side-by-side versions of Go).
|
||||
$newDirName = "Go$goVersion"
|
||||
Rename-Item -path "C:\go" -newName $newDirName
|
||||
|
||||
# Delete the Go zip archive.
|
||||
Write-Host "Deleting downloaded archive of Go $goVersion..."
|
||||
Remove-Item go$goVersion.windows-a`md64.zip
|
||||
|
||||
# Make this the default version of Go?
|
||||
if ($addToDefaultPath)
|
||||
{
|
||||
Write-Host "Adding Go $goVersion to the path..."
|
||||
# Add the Go binaries to the path.
|
||||
Add-MachinePathItem "C:\$newDirName\bin" | Out-Null
|
||||
# Set the GOROOT environment variable.
|
||||
setx GOROOT "C:\$newDirName" /M | Out-Null
|
||||
}
|
||||
|
||||
# Done
|
||||
Write-Host "Done installing Go $goVersion."
|
||||
return "C:\$newDirName"
|
||||
}
|
||||
|
||||
# Install Go
|
||||
$goVersionsToInstall = $env:GO_VERSIONS.split(",")
|
||||
|
||||
foreach($go in $goVersionsToInstall) {
|
||||
Write-Host "Installing Go ${go}"
|
||||
if($go -eq $env:GO_DEFAULT) {
|
||||
$installDirectory = Install-GoVersion -goVersion $go -addToDefaultPath
|
||||
} else {
|
||||
$installDirectory = Install-GoVersion -goVersion $go
|
||||
}
|
||||
$envName = "GOROOT_{0}_{1}_X64" -f $go.split(".")
|
||||
setx $envName "$installDirectory" /M
|
||||
}
|
||||
################################################################################
|
||||
## File: Install-Go.ps1
|
||||
## Desc: Install Go
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
function Install-GoVersion
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$goVersion,
|
||||
[Switch]$addToDefaultPath
|
||||
)
|
||||
|
||||
# Download the Go zip archive.
|
||||
Write-Host "Downloading Go $goVersion..."
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://dl.google.com/go/go$goVersion.windows-amd64.zip" -OutFile go$goVersion.windows-amd64.zip
|
||||
|
||||
# Extract the zip archive. It contains a single directory named "go".
|
||||
Write-Host "Extracting Go $goVersion..."
|
||||
Expand-Archive -Path go$goVersion.windows-amd64.zip -DestinationPath "C:\" -Force
|
||||
|
||||
# Delete unnecessary files to conserve space
|
||||
Write-Host "Cleaning directories of Go $goVersion..."
|
||||
if (Test-Path "C:\go\doc")
|
||||
{
|
||||
Remove-Item -Recurse -Force "C:\go\doc"
|
||||
}
|
||||
if (Test-Path "C:\go\blog")
|
||||
{
|
||||
Remove-Item -Recurse -Force "C:\go\blog"
|
||||
}
|
||||
|
||||
# Rename the extracted "go" directory to include the Go version number (to support side-by-side versions of Go).
|
||||
$newDirName = "Go$goVersion"
|
||||
Rename-Item -path "C:\go" -newName $newDirName
|
||||
|
||||
# Delete the Go zip archive.
|
||||
Write-Host "Deleting downloaded archive of Go $goVersion..."
|
||||
Remove-Item go$goVersion.windows-a`md64.zip
|
||||
|
||||
# Make this the default version of Go?
|
||||
if ($addToDefaultPath)
|
||||
{
|
||||
Write-Host "Adding Go $goVersion to the path..."
|
||||
# Add the Go binaries to the path.
|
||||
Add-MachinePathItem "C:\$newDirName\bin" | Out-Null
|
||||
# Set the GOROOT environment variable.
|
||||
setx GOROOT "C:\$newDirName" /M | Out-Null
|
||||
}
|
||||
|
||||
# Done
|
||||
Write-Host "Done installing Go $goVersion."
|
||||
return "C:\$newDirName"
|
||||
}
|
||||
|
||||
# Install Go
|
||||
$goVersionsToInstall = $env:GO_VERSIONS.split(",")
|
||||
|
||||
foreach($go in $goVersionsToInstall) {
|
||||
Write-Host "Installing Go ${go}"
|
||||
if($go -eq $env:GO_DEFAULT) {
|
||||
$installDirectory = Install-GoVersion -goVersion $go -addToDefaultPath
|
||||
} else {
|
||||
$installDirectory = Install-GoVersion -goVersion $go
|
||||
}
|
||||
$envName = "GOROOT_{0}_{1}_X64" -f $go.split(".")
|
||||
setx $envName "$installDirectory" /M
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
## File: Install-InnoSetup.ps1
|
||||
## Desc: Install Inno Setup
|
||||
################################################################################
|
||||
|
||||
choco install innosetup -y
|
||||
################################################################################
|
||||
## File: Install-InnoSetup.ps1
|
||||
## Desc: Install Inno Setup
|
||||
################################################################################
|
||||
|
||||
choco install innosetup -y
|
||||
|
||||
@@ -1,98 +1,98 @@
|
||||
################################################################################
|
||||
## File: Install-JavaTools.ps1
|
||||
## Desc: Install various JDKs and java tools
|
||||
################################################################################
|
||||
|
||||
# Download the Azul Systems Zulu JDKs
|
||||
# See https://www.azul.com/downloads/azure-only/zulu/
|
||||
$azulJDK7Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-7/7u232/zulu-7-azure-jdk_7.31.0.5-7.0.232-win_x64.zip'
|
||||
$azulJDK8Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-8/8u222/zulu-8-azure-jdk_8.40.0.25-8.0.222-win_x64.zip'
|
||||
$azulJDK11Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-11/11.0.4/zulu-11-azure-jdk_11.33.15-11.0.4-win_x64.zip'
|
||||
|
||||
cd $env:TEMP
|
||||
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK7Uri -OutFile azulJDK7.zip
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK8Uri -OutFile azulJDK8.zip
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK11Uri -OutFile azulJDK11.zip
|
||||
|
||||
# Expand the zips
|
||||
Expand-Archive -Path azulJDK7.zip -DestinationPath "C:\Program Files\Java\" -Force
|
||||
Expand-Archive -Path azulJDK8.zip -DestinationPath "C:\Program Files\Java\" -Force
|
||||
Expand-Archive -Path azulJDK11.zip -DestinationPath "C:\Program Files\Java\" -Force
|
||||
|
||||
# Deleting zip folders
|
||||
Remove-Item -Recurse -Force azulJDK7.zip
|
||||
Remove-Item -Recurse -Force azulJDK8.zip
|
||||
Remove-Item -Recurse -Force azulJDK11.zip
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$currentPath = Get-MachinePath
|
||||
|
||||
$pathSegments = $currentPath.Split(';')
|
||||
$newPathSegments = @()
|
||||
|
||||
foreach ($pathSegment in $pathSegments)
|
||||
{
|
||||
if($pathSegment -notlike '*java*')
|
||||
{
|
||||
$newPathSegments += $pathSegment
|
||||
}
|
||||
}
|
||||
|
||||
$java7Installs = Get-ChildItem -Path 'C:\Program Files\Java' -Filter '*azure-jdk*7*' | Sort-Object -Property Name -Descending | Select-Object -First 1
|
||||
$latestJava7Install = $java7Installs.FullName;
|
||||
|
||||
$java8Installs = Get-ChildItem -Path 'C:\Program Files\Java' -Filter '*azure-jdk*8*' | Sort-Object -Property Name -Descending | Select-Object -First 1
|
||||
$latestJava8Install = $java8Installs.FullName;
|
||||
|
||||
$java11Installs = Get-ChildItem -Path 'C:\Program Files\Java' -Filter '*azure-jdk*11*' | Sort-Object -Property Name -Descending | Select-Object -First 1
|
||||
$latestJava11Install = $java11Installs.FullName;
|
||||
|
||||
$newPath = [string]::Join(';', $newPathSegments)
|
||||
$newPath = $latestJava8Install + '\bin;' + $newPath
|
||||
|
||||
Set-MachinePath -NewPath $newPath
|
||||
|
||||
setx JAVA_HOME $latestJava8Install /M
|
||||
setx JAVA_HOME_7_X64 $latestJava7Install /M
|
||||
setx JAVA_HOME_8_X64 $latestJava8Install /M
|
||||
setx JAVA_HOME_11_X64 $latestJava11Install /M
|
||||
|
||||
# Install Java tools
|
||||
# Force chocolatey to ignore dependencies on Ant and Maven or else they will download the Oracle JDK
|
||||
choco install ant -y -i
|
||||
choco install maven -y -i --version=3.6.2
|
||||
choco install gradle -y
|
||||
|
||||
# Move maven variables to Machine. They may not be in the environment for this script so we need to read them from the registry.
|
||||
$userSid = (Get-WmiObject win32_useraccount -Filter "name = '$env:USERNAME' AND domain = '$env:USERDOMAIN'").SID
|
||||
$userEnvironmentKey = 'Registry::HKEY_USERS\' + $userSid + '\Environment'
|
||||
|
||||
$m2_home = (Get-ItemProperty -Path $userEnvironmentKey -Name M2_HOME).M2_HOME
|
||||
$m2 = $m2_home + '\bin'
|
||||
$maven_opts = '-Xms256m'
|
||||
|
||||
$m2_repo = 'C:\ProgramData\m2'
|
||||
New-Item -Path $m2_repo -ItemType Directory -Force
|
||||
|
||||
setx M2 $m2 /M
|
||||
setx M2_HOME $m2_home /M
|
||||
setx M2_REPO $m2_repo /M
|
||||
setx MAVEN_OPTS $maven_opts /M
|
||||
|
||||
# Download cobertura jars
|
||||
$uri = 'https://ayera.dl.sourceforge.net/project/cobertura/cobertura/2.1.1/cobertura-2.1.1-bin.zip'
|
||||
$coberturaPath = "C:\cobertura-2.1.1"
|
||||
|
||||
cd $env:TEMP
|
||||
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $uri -OutFile cobertura.zip
|
||||
|
||||
# Expand the zip
|
||||
Expand-Archive -Path cobertura.zip -DestinationPath "C:\" -Force
|
||||
|
||||
# Deleting zip folder
|
||||
Remove-Item -Recurse -Force cobertura.zip
|
||||
|
||||
setx COBERTURA_HOME $coberturaPath /M
|
||||
################################################################################
|
||||
## File: Install-JavaTools.ps1
|
||||
## Desc: Install various JDKs and java tools
|
||||
################################################################################
|
||||
|
||||
# Download the Azul Systems Zulu JDKs
|
||||
# See https://www.azul.com/downloads/azure-only/zulu/
|
||||
$azulJDK7Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-7/7u232/zulu-7-azure-jdk_7.31.0.5-7.0.232-win_x64.zip'
|
||||
$azulJDK8Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-8/8u222/zulu-8-azure-jdk_8.40.0.25-8.0.222-win_x64.zip'
|
||||
$azulJDK11Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-11/11.0.4/zulu-11-azure-jdk_11.33.15-11.0.4-win_x64.zip'
|
||||
|
||||
cd $env:TEMP
|
||||
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK7Uri -OutFile azulJDK7.zip
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK8Uri -OutFile azulJDK8.zip
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK11Uri -OutFile azulJDK11.zip
|
||||
|
||||
# Expand the zips
|
||||
Expand-Archive -Path azulJDK7.zip -DestinationPath "C:\Program Files\Java\" -Force
|
||||
Expand-Archive -Path azulJDK8.zip -DestinationPath "C:\Program Files\Java\" -Force
|
||||
Expand-Archive -Path azulJDK11.zip -DestinationPath "C:\Program Files\Java\" -Force
|
||||
|
||||
# Deleting zip folders
|
||||
Remove-Item -Recurse -Force azulJDK7.zip
|
||||
Remove-Item -Recurse -Force azulJDK8.zip
|
||||
Remove-Item -Recurse -Force azulJDK11.zip
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$currentPath = Get-MachinePath
|
||||
|
||||
$pathSegments = $currentPath.Split(';')
|
||||
$newPathSegments = @()
|
||||
|
||||
foreach ($pathSegment in $pathSegments)
|
||||
{
|
||||
if($pathSegment -notlike '*java*')
|
||||
{
|
||||
$newPathSegments += $pathSegment
|
||||
}
|
||||
}
|
||||
|
||||
$java7Installs = Get-ChildItem -Path 'C:\Program Files\Java' -Filter '*azure-jdk*7*' | Sort-Object -Property Name -Descending | Select-Object -First 1
|
||||
$latestJava7Install = $java7Installs.FullName;
|
||||
|
||||
$java8Installs = Get-ChildItem -Path 'C:\Program Files\Java' -Filter '*azure-jdk*8*' | Sort-Object -Property Name -Descending | Select-Object -First 1
|
||||
$latestJava8Install = $java8Installs.FullName;
|
||||
|
||||
$java11Installs = Get-ChildItem -Path 'C:\Program Files\Java' -Filter '*azure-jdk*11*' | Sort-Object -Property Name -Descending | Select-Object -First 1
|
||||
$latestJava11Install = $java11Installs.FullName;
|
||||
|
||||
$newPath = [string]::Join(';', $newPathSegments)
|
||||
$newPath = $latestJava8Install + '\bin;' + $newPath
|
||||
|
||||
Set-MachinePath -NewPath $newPath
|
||||
|
||||
setx JAVA_HOME $latestJava8Install /M
|
||||
setx JAVA_HOME_7_X64 $latestJava7Install /M
|
||||
setx JAVA_HOME_8_X64 $latestJava8Install /M
|
||||
setx JAVA_HOME_11_X64 $latestJava11Install /M
|
||||
|
||||
# Install Java tools
|
||||
# Force chocolatey to ignore dependencies on Ant and Maven or else they will download the Oracle JDK
|
||||
choco install ant -y -i
|
||||
choco install maven -y -i --version=3.6.2
|
||||
choco install gradle -y
|
||||
|
||||
# Move maven variables to Machine. They may not be in the environment for this script so we need to read them from the registry.
|
||||
$userSid = (Get-WmiObject win32_useraccount -Filter "name = '$env:USERNAME' AND domain = '$env:USERDOMAIN'").SID
|
||||
$userEnvironmentKey = 'Registry::HKEY_USERS\' + $userSid + '\Environment'
|
||||
|
||||
$m2_home = (Get-ItemProperty -Path $userEnvironmentKey -Name M2_HOME).M2_HOME
|
||||
$m2 = $m2_home + '\bin'
|
||||
$maven_opts = '-Xms256m'
|
||||
|
||||
$m2_repo = 'C:\ProgramData\m2'
|
||||
New-Item -Path $m2_repo -ItemType Directory -Force
|
||||
|
||||
setx M2 $m2 /M
|
||||
setx M2_HOME $m2_home /M
|
||||
setx M2_REPO $m2_repo /M
|
||||
setx MAVEN_OPTS $maven_opts /M
|
||||
|
||||
# Download cobertura jars
|
||||
$uri = 'https://ayera.dl.sourceforge.net/project/cobertura/cobertura/2.1.1/cobertura-2.1.1-bin.zip'
|
||||
$coberturaPath = "C:\cobertura-2.1.1"
|
||||
|
||||
cd $env:TEMP
|
||||
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $uri -OutFile cobertura.zip
|
||||
|
||||
# Expand the zip
|
||||
Expand-Archive -Path cobertura.zip -DestinationPath "C:\" -Force
|
||||
|
||||
# Deleting zip folder
|
||||
Remove-Item -Recurse -Force cobertura.zip
|
||||
|
||||
setx COBERTURA_HOME $coberturaPath /M
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
## File: Install-Jq.ps1
|
||||
## Desc: Install jq
|
||||
################################################################################
|
||||
|
||||
choco install jq -y
|
||||
################################################################################
|
||||
## File: Install-Jq.ps1
|
||||
## Desc: Install jq
|
||||
################################################################################
|
||||
|
||||
choco install jq -y
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
################################################################################
|
||||
## File: Install-Kind.ps1
|
||||
## Desc: Install Kind
|
||||
################################################################################
|
||||
|
||||
$stableKindTag = "v0.5.1"
|
||||
$tagToUse = $stableKindTag;
|
||||
$destFilePath = "C:\ProgramData\kind"
|
||||
$outFilePath = "C:\ProgramData\kind\kind.exe"
|
||||
|
||||
try
|
||||
{
|
||||
$getkindUri = "https://github.com/kubernetes-sigs/kind/releases/download/$tagToUse/kind-windows-amd64"
|
||||
Write-Host "Downloading kind.exe..."
|
||||
New-Item -Path $destFilePath -ItemType Directory -Force
|
||||
|
||||
Invoke-WebRequest -Uri $getkindUri -OutFile $outFilePath
|
||||
|
||||
Write-Host "Starting Install kind.exe..."
|
||||
$process = Start-Process -FilePath $outFilePath -Wait -PassThru
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||
{
|
||||
Write-Host -Object 'Installation successful'
|
||||
Add-MachinePathItem $destFilePath
|
||||
exit $exitCode
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
|
||||
exit $exitCode
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host -Object "Failed to install the Executable kind.exe"
|
||||
Write-Host -Object $_.Exception.Message
|
||||
exit -1
|
||||
}
|
||||
################################################################################
|
||||
## File: Install-Kind.ps1
|
||||
## Desc: Install Kind
|
||||
################################################################################
|
||||
|
||||
$stableKindTag = "v0.5.1"
|
||||
$tagToUse = $stableKindTag;
|
||||
$destFilePath = "C:\ProgramData\kind"
|
||||
$outFilePath = "C:\ProgramData\kind\kind.exe"
|
||||
|
||||
try
|
||||
{
|
||||
$getkindUri = "https://github.com/kubernetes-sigs/kind/releases/download/$tagToUse/kind-windows-amd64"
|
||||
Write-Host "Downloading kind.exe..."
|
||||
New-Item -Path $destFilePath -ItemType Directory -Force
|
||||
|
||||
Invoke-WebRequest -Uri $getkindUri -OutFile $outFilePath
|
||||
|
||||
Write-Host "Starting Install kind.exe..."
|
||||
$process = Start-Process -FilePath $outFilePath -Wait -PassThru
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||
{
|
||||
Write-Host -Object 'Installation successful'
|
||||
Add-MachinePathItem $destFilePath
|
||||
exit $exitCode
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
|
||||
exit $exitCode
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host -Object "Failed to install the Executable kind.exe"
|
||||
Write-Host -Object $_.Exception.Message
|
||||
exit -1
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
## File: Install-KubernetesCli.ps1
|
||||
## Desc: Install KubernetesCli
|
||||
################################################################################
|
||||
|
||||
choco install kubernetes-cli -y
|
||||
################################################################################
|
||||
## File: Install-KubernetesCli.ps1
|
||||
## Desc: Install KubernetesCli
|
||||
################################################################################
|
||||
|
||||
choco install kubernetes-cli -y
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
################################################################################
|
||||
## File: Install-Mercurial.ps1
|
||||
## Desc: Install Mercurial
|
||||
################################################################################
|
||||
|
||||
choco install hg -y --version 5.0.0
|
||||
|
||||
$hgPath = "${env:ProgramFiles}\Mercurial\"
|
||||
Add-MachinePathItem $hgPath
|
||||
$env:Path = Get-MachinePath
|
||||
################################################################################
|
||||
## File: Install-Mercurial.ps1
|
||||
## Desc: Install Mercurial
|
||||
################################################################################
|
||||
|
||||
choco install hg -y --version 5.0.0
|
||||
|
||||
$hgPath = "${env:ProgramFiles}\Mercurial\"
|
||||
Add-MachinePathItem $hgPath
|
||||
$env:Path = Get-MachinePath
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
################################################################################
|
||||
## File: Install-MinGW.ps1
|
||||
## Desc: Install GNU tools for Windows to C:\tools\mingw64
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
choco install -y mingw
|
||||
|
||||
# Make a copy of mingw32-make.exe to make.exe, which is a more discoverable name
|
||||
# and so the same command line can be used on Windows as on macOS and Linux
|
||||
$path = where.exe mingw32-make.exe | Get-Item
|
||||
Copy-Item -Path $path -Destination (Join-Path $path.Directory 'make.exe')
|
||||
################################################################################
|
||||
## File: Install-MinGW.ps1
|
||||
## Desc: Install GNU tools for Windows to C:\tools\mingw64
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
choco install -y mingw
|
||||
|
||||
# Make a copy of mingw32-make.exe to make.exe, which is a more discoverable name
|
||||
# and so the same command line can be used on Windows as on macOS and Linux
|
||||
$path = where.exe mingw32-make.exe | Get-Item
|
||||
Copy-Item -Path $path -Destination (Join-Path $path.Directory 'make.exe')
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
################################################################################
|
||||
## File: Install-Miniconda.ps1
|
||||
## Desc: Install the latest version of Miniconda and set $env:CONDA
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
# Lock to Miniconda 4.6 until we do the work to run `conda init` for the vsts user
|
||||
# Then we can go back to installing the latest Miniconda
|
||||
# $url = "https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe"
|
||||
$url = "https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Windows-x86_64.exe"
|
||||
$name = $Url.Split('/')[-1]
|
||||
$destination = "C:\Miniconda"
|
||||
|
||||
Install-EXE -Url $url -Name $name -ArgumentList "/S /AddToPath=0 /RegisterPython=0 /D=$destination"
|
||||
Set-SystemVariable -SystemVariable "CONDA" -Value $destination
|
||||
################################################################################
|
||||
## File: Install-Miniconda.ps1
|
||||
## Desc: Install the latest version of Miniconda and set $env:CONDA
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
# Lock to Miniconda 4.6 until we do the work to run `conda init` for the vsts user
|
||||
# Then we can go back to installing the latest Miniconda
|
||||
# $url = "https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe"
|
||||
$url = "https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Windows-x86_64.exe"
|
||||
$name = $Url.Split('/')[-1]
|
||||
$destination = "C:\Miniconda"
|
||||
|
||||
Install-EXE -Url $url -Name $name -ArgumentList "/S /AddToPath=0 /RegisterPython=0 /D=$destination"
|
||||
Set-SystemVariable -SystemVariable "CONDA" -Value $destination
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
################################################################################
|
||||
## File: Install-MysqlCli.ps1
|
||||
## Desc: Install Mysql CLI
|
||||
################################################################################
|
||||
|
||||
|
||||
## Downloading mysql jar
|
||||
$uri = 'https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21-winx64.zip'
|
||||
$mysqlPath = 'C:\mysql-5.7.21-winx64\bin'
|
||||
|
||||
# Installing visual c++ redistibutable package.
|
||||
$InstallerURI = 'https://download.microsoft.com/download/0/5/6/056dcda9-d667-4e27-8001-8a0c6971d6b1/vcredist_x64.exe'
|
||||
$InstallerName = 'vcredist_x64.exe'
|
||||
$ArgumentList = ('/install', '/quiet', '/norestart' )
|
||||
|
||||
$exitCode = Install-EXE -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||
{
|
||||
# MySQL disabled TLS 1.0 support on or about Jul-14-2018. Need to make sure TLS 1.2 is enabled.
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"
|
||||
|
||||
# Get the latest mysql command line tools .
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $uri -OutFile mysql.zip
|
||||
|
||||
# Expand the zip
|
||||
Expand-Archive -Path mysql.zip -DestinationPath "C:\" -Force
|
||||
|
||||
# Deleting zip folder
|
||||
Remove-Item -Recurse -Force mysql.zip
|
||||
|
||||
# Adding mysql in system environment path
|
||||
Add-MachinePathItem $mysqlPath
|
||||
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $exitCode;
|
||||
}
|
||||
################################################################################
|
||||
## File: Install-MysqlCli.ps1
|
||||
## Desc: Install Mysql CLI
|
||||
################################################################################
|
||||
|
||||
|
||||
## Downloading mysql jar
|
||||
$uri = 'https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21-winx64.zip'
|
||||
$mysqlPath = 'C:\mysql-5.7.21-winx64\bin'
|
||||
|
||||
# Installing visual c++ redistibutable package.
|
||||
$InstallerURI = 'https://download.microsoft.com/download/0/5/6/056dcda9-d667-4e27-8001-8a0c6971d6b1/vcredist_x64.exe'
|
||||
$InstallerName = 'vcredist_x64.exe'
|
||||
$ArgumentList = ('/install', '/quiet', '/norestart' )
|
||||
|
||||
$exitCode = Install-EXE -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||
{
|
||||
# MySQL disabled TLS 1.0 support on or about Jul-14-2018. Need to make sure TLS 1.2 is enabled.
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"
|
||||
|
||||
# Get the latest mysql command line tools .
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $uri -OutFile mysql.zip
|
||||
|
||||
# Expand the zip
|
||||
Expand-Archive -Path mysql.zip -DestinationPath "C:\" -Force
|
||||
|
||||
# Deleting zip folder
|
||||
Remove-Item -Recurse -Force mysql.zip
|
||||
|
||||
# Adding mysql in system environment path
|
||||
Add-MachinePathItem $mysqlPath
|
||||
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $exitCode;
|
||||
}
|
||||
|
||||
13
images/win/scripts/Installers/Install-NET472.ps1
Normal file
13
images/win/scripts/Installers/Install-NET472.ps1
Normal file
@@ -0,0 +1,13 @@
|
||||
################################################################################
|
||||
## File: Install-NET472.ps1
|
||||
## Desc: Install .NET 4.7.2
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
# .NET 4.7.2 Dev pack
|
||||
$InstallerURI = "https://download.microsoft.com/download/3/B/F/3BFB9C35-405D-45DF-BDAF-0EB57D047888/NDP472-DevPack-ENU.exe"
|
||||
$InstallerName = "NDP472-DevPack-ENU.exe"
|
||||
$ArgumentList = ('Setup', '/passive', '/norestart' )
|
||||
|
||||
Install-EXE -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList
|
||||
@@ -1,13 +1,13 @@
|
||||
################################################################################
|
||||
## File: Install-NET48.ps1
|
||||
## Desc: Install .NET 4.8
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
# .NET 4.8 Dev pack
|
||||
$InstallerURI = "https://download.visualstudio.microsoft.com/download/pr/014120d7-d689-4305-befd-3cb711108212/0307177e14752e359fde5423ab583e43/ndp48-devpack-enu.exe"
|
||||
$InstallerName = "NDP48-DevPack-ENU.exe"
|
||||
$ArgumentList = ('Setup', '/passive', '/norestart' )
|
||||
|
||||
Install-EXE -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList
|
||||
################################################################################
|
||||
## File: Install-NET48.ps1
|
||||
## Desc: Install .NET 4.8
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
# .NET 4.8 Dev pack
|
||||
$InstallerURI = "https://download.visualstudio.microsoft.com/download/pr/7afca223-55d2-470a-8edc-6a1739ae3252/c8c829444416e811be84c5765ede6148/NDP48-DevPack-ENU.exe"
|
||||
$InstallerName = "NDP48-DevPack-ENU.exe"
|
||||
$ArgumentList = ('Setup', '/passive', '/norestart' )
|
||||
|
||||
Install-EXE -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
################################################################################
|
||||
## File: Install-NSIS.ps1
|
||||
## Desc: Install NSIS
|
||||
################################################################################
|
||||
|
||||
choco install nsis -y
|
||||
|
||||
$NsisPath = "${env:ProgramFiles(x86)}\NSIS\"
|
||||
Add-MachinePathItem $NsisPath
|
||||
$env:Path = Get-MachinePath
|
||||
################################################################################
|
||||
## File: Install-NSIS.ps1
|
||||
## Desc: Install NSIS
|
||||
################################################################################
|
||||
|
||||
choco install nsis -y
|
||||
|
||||
$NsisPath = "${env:ProgramFiles(x86)}\NSIS\"
|
||||
Add-MachinePathItem $NsisPath
|
||||
$env:Path = Get-MachinePath
|
||||
|
||||
@@ -1,34 +1,33 @@
|
||||
################################################################################
|
||||
## File: Install-NodeLts.ps1
|
||||
## Desc: Install nodejs-lts and other common node tools.
|
||||
## Must run after python is configured
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$PrefixPath = 'C:\npm\prefix'
|
||||
$CachePath = 'C:\npm\cache'
|
||||
|
||||
New-Item -Path $PrefixPath -Force -ItemType Directory
|
||||
New-Item -Path $CachePath -Force -ItemType Directory
|
||||
|
||||
choco install nodejs-lts -y --force
|
||||
|
||||
Add-MachinePathItem $PrefixPath
|
||||
$env:Path = Get-MachinePath
|
||||
|
||||
setx NPM_CONFIG_PREFIX $PrefixPath /M
|
||||
$env:NPM_CONFIG_PREFIX = $PrefixPath
|
||||
|
||||
setx NPM_CONFIG_CACHE $CachePath /M
|
||||
$env:NPM_CONFIG_CACHE = $CachePath
|
||||
|
||||
npm config set registry http://registry.npmjs.org/
|
||||
|
||||
npm install -g bower
|
||||
npm install -g cordova
|
||||
npm install -g grunt-cli
|
||||
npm install -g gulp-cli
|
||||
npm install -g parcel-bundler
|
||||
npm install -g --save-dev webpack webpack-cli
|
||||
npm install -g yarn
|
||||
################################################################################
|
||||
## File: Install-NodeLts.ps1
|
||||
## Desc: Install nodejs-lts and other common node tools.
|
||||
## Must run after python is configured
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$PrefixPath = 'C:\npm\prefix'
|
||||
$CachePath = 'C:\npm\cache'
|
||||
|
||||
New-Item -Path $PrefixPath -Force -ItemType Directory
|
||||
New-Item -Path $CachePath -Force -ItemType Directory
|
||||
|
||||
choco install nodejs-lts -y --force
|
||||
|
||||
Add-MachinePathItem $PrefixPath
|
||||
$env:Path = Get-MachinePath
|
||||
|
||||
setx NPM_CONFIG_PREFIX $PrefixPath /M
|
||||
$env:NPM_CONFIG_PREFIX = $PrefixPath
|
||||
|
||||
setx NPM_CONFIG_CACHE $CachePath /M
|
||||
$env:NPM_CONFIG_CACHE = $CachePath
|
||||
|
||||
npm config set registry http://registry.npmjs.org/
|
||||
|
||||
npm install -g cordova
|
||||
npm install -g grunt-cli
|
||||
npm install -g gulp-cli
|
||||
npm install -g parcel-bundler
|
||||
npm install -g --save-dev webpack webpack-cli
|
||||
npm install -g yarn
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
## File: Install-OpenSSL.ps1
|
||||
## Desc: Install OpenSSL
|
||||
################################################################################
|
||||
|
||||
choco install openssl.light -y
|
||||
################################################################################
|
||||
## File: Install-OpenSSL.ps1
|
||||
## Desc: Install OpenSSL
|
||||
################################################################################
|
||||
|
||||
choco install openssl.light -y
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
################################################################################
|
||||
## File: Install-PHP.ps1
|
||||
## Desc: Install PHP
|
||||
################################################################################
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Import-Module -Name ImageHelpers
|
||||
|
||||
# Install latest PHP in chocolatey
|
||||
$installDir = "c:\tools\php"
|
||||
choco install php -y --force --params "/InstallDir:$installDir"
|
||||
|
||||
# update path to extensions and enable curl and mbstring extensions
|
||||
((Get-Content -path $installDir\php.ini -Raw) -replace ';extension=curl','extension=curl' -replace ';extension=mbstring','extension=mbstring' -replace ';extension_dir = "ext"','extension_dir = "ext"') | Set-Content -Path $installDir\php.ini
|
||||
|
||||
# Set the PHPROOT environment variable.
|
||||
setx PHPROOT $installDir /M
|
||||
|
||||
# Done
|
||||
exit 0
|
||||
################################################################################
|
||||
## File: Install-PHP.ps1
|
||||
## Desc: Install PHP
|
||||
################################################################################
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Import-Module -Name ImageHelpers
|
||||
|
||||
# Install latest PHP in chocolatey
|
||||
$installDir = "c:\tools\php"
|
||||
choco install php -y --force --params "/InstallDir:$installDir"
|
||||
|
||||
# update path to extensions and enable curl and mbstring extensions
|
||||
((Get-Content -path $installDir\php.ini -Raw) -replace ';extension=curl','extension=curl' -replace ';extension=mbstring','extension=mbstring' -replace ';extension_dir = "ext"','extension_dir = "ext"') | Set-Content -Path $installDir\php.ini
|
||||
|
||||
# Set the PHPROOT environment variable.
|
||||
setx PHPROOT $installDir /M
|
||||
|
||||
# Done
|
||||
exit 0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
## File: Install-Perl.ps1
|
||||
## Desc: Install Perl
|
||||
################################################################################
|
||||
|
||||
choco install strawberryperl -y
|
||||
################################################################################
|
||||
## File: Install-Perl.ps1
|
||||
## Desc: Install Perl
|
||||
################################################################################
|
||||
|
||||
choco install strawberryperl -y
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
## File: Install-PowershellCore.ps1
|
||||
## Desc: Install PowerShell Core
|
||||
################################################################################
|
||||
|
||||
Invoke-Expression "& { $(Invoke-RestMethod https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet"
|
||||
################################################################################
|
||||
## File: Install-PowershellCore.ps1
|
||||
## Desc: Install PowerShell Core
|
||||
################################################################################
|
||||
|
||||
Invoke-Expression "& { $(Invoke-RestMethod https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet"
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
################################################################################
|
||||
## File: Install-Ruby.ps1
|
||||
## Desc: Install Ruby for Windows
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers
|
||||
|
||||
# Ruby versions are already available in the tool cache.
|
||||
|
||||
# Tool cache Ruby Path
|
||||
$toolcacheRubyPath = 'C:\hostedtoolcache\windows\Ruby\2.5.*'
|
||||
|
||||
# Get Latest Ruby 2.5.x
|
||||
$latestRubyBinPath2_5 = Get-ChildItem -Path $toolcacheRubyPath | Sort-Object {[System.Version]$_.Name} | Select-Object -Last 1 | ForEach-Object {
|
||||
Join-Path $_.FullName 'x64\bin'
|
||||
}
|
||||
|
||||
Add-MachinePathItem $latestRubyBinPath2_5
|
||||
$env:Path = Get-MachinePath
|
||||
exit 0
|
||||
################################################################################
|
||||
## File: Install-Ruby.ps1
|
||||
## Desc: Install Ruby for Windows
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers
|
||||
|
||||
# Ruby versions are already available in the tool cache.
|
||||
|
||||
# Tool cache Ruby Path
|
||||
$toolcacheRubyPath = 'C:\hostedtoolcache\windows\Ruby\2.5.*'
|
||||
|
||||
# Get Latest Ruby 2.5.x
|
||||
$latestRubyBinPath2_5 = Get-ChildItem -Path $toolcacheRubyPath | Sort-Object {[System.Version]$_.Name} | Select-Object -Last 1 | ForEach-Object {
|
||||
Join-Path $_.FullName 'x64\bin'
|
||||
}
|
||||
|
||||
Add-MachinePathItem $latestRubyBinPath2_5
|
||||
$env:Path = Get-MachinePath
|
||||
exit 0
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
################################################################################
|
||||
## File: Install-Rust.ps1
|
||||
## Desc: Install Rust for Windows
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers
|
||||
|
||||
# Rust Env
|
||||
$env:RUSTUP_HOME="C:\Rust\.rustup"
|
||||
$env:CARGO_HOME="C:\Rust\.cargo"
|
||||
|
||||
# Download the latest rustup-init.exe for Windows x64
|
||||
# See https://rustup.rs/#
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://win.rustup.rs/x86_64" -OutFile rustup-init.exe
|
||||
|
||||
# Install Rust by running rustup-init.exe (disabling the confirmation prompt with -y)
|
||||
.\rustup-init.exe -y
|
||||
|
||||
# Delete rustup-init.exe when it's no longer needed
|
||||
Remove-Item -Path .\rustup-init.exe
|
||||
|
||||
# Add Rust binaries to the path
|
||||
Add-MachinePathItem "$env:CARGO_HOME\bin"
|
||||
$env:Path = Get-MachinePath
|
||||
|
||||
# Install common tools
|
||||
rustup component add rustfmt
|
||||
rustup component add clippy
|
||||
cargo install bindgen
|
||||
cargo install cbindgen
|
||||
|
||||
# Run script at startup for all users
|
||||
$cmdRustSymScript = @"
|
||||
@echo off
|
||||
|
||||
if exist $env:CARGO_HOME (
|
||||
if not exist %USERPROFILE%\.cargo (
|
||||
mklink /J %USERPROFILE%\.cargo $env:CARGO_HOME
|
||||
)
|
||||
)
|
||||
|
||||
if exist $env:RUSTUP_HOME (
|
||||
if not exist %USERPROFILE%\.rustup (
|
||||
mklink /J %USERPROFILE%\.rustup $env:RUSTUP_HOME
|
||||
)
|
||||
)
|
||||
"@
|
||||
|
||||
$cmdPath = "C:\Rust\rustsym.bat"
|
||||
$cmdRustSymScript | Out-File -Encoding ascii -FilePath $cmdPath
|
||||
|
||||
# Update Run key to run a script at logon
|
||||
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" -Name "RUSTSYM" -Value $cmdPath
|
||||
################################################################################
|
||||
## File: Install-Rust.ps1
|
||||
## Desc: Install Rust for Windows
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers
|
||||
|
||||
# Rust Env
|
||||
$env:RUSTUP_HOME="C:\Rust\.rustup"
|
||||
$env:CARGO_HOME="C:\Rust\.cargo"
|
||||
|
||||
# Download the latest rustup-init.exe for Windows x64
|
||||
# See https://rustup.rs/#
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://win.rustup.rs/x86_64" -OutFile rustup-init.exe
|
||||
|
||||
# Install Rust by running rustup-init.exe (disabling the confirmation prompt with -y)
|
||||
.\rustup-init.exe -y
|
||||
|
||||
# Delete rustup-init.exe when it's no longer needed
|
||||
Remove-Item -Path .\rustup-init.exe
|
||||
|
||||
# Add Rust binaries to the path
|
||||
Add-MachinePathItem "$env:CARGO_HOME\bin"
|
||||
$env:Path = Get-MachinePath
|
||||
|
||||
# Install common tools
|
||||
rustup component add rustfmt
|
||||
rustup component add clippy
|
||||
cargo install bindgen
|
||||
cargo install cbindgen
|
||||
|
||||
# Run script at startup for all users
|
||||
$cmdRustSymScript = @"
|
||||
@echo off
|
||||
|
||||
if exist $env:CARGO_HOME (
|
||||
if not exist %USERPROFILE%\.cargo (
|
||||
mklink /J %USERPROFILE%\.cargo $env:CARGO_HOME
|
||||
)
|
||||
)
|
||||
|
||||
if exist $env:RUSTUP_HOME (
|
||||
if not exist %USERPROFILE%\.rustup (
|
||||
mklink /J %USERPROFILE%\.rustup $env:RUSTUP_HOME
|
||||
)
|
||||
)
|
||||
"@
|
||||
|
||||
$cmdPath = "C:\Rust\rustsym.bat"
|
||||
$cmdRustSymScript | Out-File -Encoding ascii -FilePath $cmdPath
|
||||
|
||||
# Update Run key to run a script at logon
|
||||
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" -Name "RUSTSYM" -Value $cmdPath
|
||||
|
||||
@@ -1,61 +1,61 @@
|
||||
################################################################################
|
||||
## File: Install-SQLPowerShellTools.ps1
|
||||
## Desc: Install SQL PowerShell tool
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
Function InstallMSI
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$MsiUrl,
|
||||
[String]$MsiName
|
||||
)
|
||||
|
||||
$exitCode = -1
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Downloading $MsiName..."
|
||||
$FilePath = "${env:Temp}\$MsiName"
|
||||
|
||||
Invoke-WebRequest -Uri $MsiUrl -OutFile $FilePath
|
||||
|
||||
$Arguments = ('/i', $FilePath, '/QN', '/norestart' )
|
||||
|
||||
Write-Host "Starting Install $MsiName..."
|
||||
$process = Start-Process -FilePath msiexec.exe -ArgumentList $Arguments -Wait -PassThru
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||
{
|
||||
Write-Host -Object 'Installation successful'
|
||||
return $exitCode
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
|
||||
exit $exitCode
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host -Object "Failed to install the MSI $MsiName"
|
||||
Write-Host -Object $_.Exception.Message
|
||||
exit -1
|
||||
}
|
||||
}
|
||||
|
||||
# install required MSIs
|
||||
$SQLSysClrTypesExitCode = InstallMSI -MsiUrl "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64/SQLSysClrTypes.msi" -MsiName "SQLSysClrTypes.msi"
|
||||
|
||||
$SharedManagementObjectsExitCode = InstallMSI -MsiUrl "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64/SharedManagementObjects.msi" -MsiName "SharedManagementObjects.msi"
|
||||
|
||||
$PowerShellToolsExitCode = InstallMSI -MsiUrl "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64/PowerShellTools.msi" -MsiName "PowerShellTools.msi"
|
||||
|
||||
# install sqlserver PS module
|
||||
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
|
||||
Install-Module -Name SqlServer -AllowClobber
|
||||
|
||||
exit $PowerShellToolsExitCode
|
||||
################################################################################
|
||||
## File: Install-SQLPowerShellTools.ps1
|
||||
## Desc: Install SQL PowerShell tool
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
Function InstallMSI
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$MsiUrl,
|
||||
[String]$MsiName
|
||||
)
|
||||
|
||||
$exitCode = -1
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Downloading $MsiName..."
|
||||
$FilePath = "${env:Temp}\$MsiName"
|
||||
|
||||
Invoke-WebRequest -Uri $MsiUrl -OutFile $FilePath
|
||||
|
||||
$Arguments = ('/i', $FilePath, '/QN', '/norestart' )
|
||||
|
||||
Write-Host "Starting Install $MsiName..."
|
||||
$process = Start-Process -FilePath msiexec.exe -ArgumentList $Arguments -Wait -PassThru
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||
{
|
||||
Write-Host -Object 'Installation successful'
|
||||
return $exitCode
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
|
||||
exit $exitCode
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host -Object "Failed to install the MSI $MsiName"
|
||||
Write-Host -Object $_.Exception.Message
|
||||
exit -1
|
||||
}
|
||||
}
|
||||
|
||||
# install required MSIs
|
||||
$SQLSysClrTypesExitCode = InstallMSI -MsiUrl "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64/SQLSysClrTypes.msi" -MsiName "SQLSysClrTypes.msi"
|
||||
|
||||
$SharedManagementObjectsExitCode = InstallMSI -MsiUrl "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64/SharedManagementObjects.msi" -MsiName "SharedManagementObjects.msi"
|
||||
|
||||
$PowerShellToolsExitCode = InstallMSI -MsiUrl "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64/PowerShellTools.msi" -MsiName "PowerShellTools.msi"
|
||||
|
||||
# install sqlserver PS module
|
||||
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
|
||||
Install-Module -Name SqlServer -AllowClobber
|
||||
|
||||
exit $PowerShellToolsExitCode
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
################################################################################
|
||||
## File: Install-Sbt.ps1
|
||||
## Team: CI-X
|
||||
## Desc: Install sbt for Windows
|
||||
################################################################################
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
################################################################################
|
||||
## File: Install-SeleniumWebDrivers.ps1
|
||||
## Desc: Install Selenium Web Drivers
|
||||
################################################################################
|
||||
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://seleniumwebdrivers.blob.core.windows.net/seleniumwebdrivers/SeleniumWebDrivers.zip" -OutFile SeleniumWebDrivers.zip
|
||||
|
||||
Expand-Archive -Path SeleniumWebDrivers.zip -DestinationPath "C:\" -Force
|
||||
|
||||
Remove-Item SeleniumWebDrivers.zip
|
||||
|
||||
setx IEWebDriver "C:\SeleniumWebDrivers\IEDriver" /M
|
||||
setx GeckoWebDriver "C:\SeleniumWebDrivers\GeckoDriver" /M
|
||||
setx ChromeWebDriver "C:\SeleniumWebDrivers\ChromeDriver" /M
|
||||
|
||||
exit 0
|
||||
|
||||
################################################################################
|
||||
## File: Install-SeleniumWebDrivers.ps1
|
||||
## Desc: Install Selenium Web Drivers
|
||||
################################################################################
|
||||
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://seleniumwebdrivers.blob.core.windows.net/seleniumwebdrivers/SeleniumWebDrivers.zip" -OutFile SeleniumWebDrivers.zip
|
||||
|
||||
Expand-Archive -Path SeleniumWebDrivers.zip -DestinationPath "C:\" -Force
|
||||
|
||||
Remove-Item SeleniumWebDrivers.zip
|
||||
|
||||
setx IEWebDriver "C:\SeleniumWebDrivers\IEDriver" /M
|
||||
setx GeckoWebDriver "C:\SeleniumWebDrivers\GeckoDriver" /M
|
||||
setx ChromeWebDriver "C:\SeleniumWebDrivers\ChromeDriver" /M
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
################################################################################
|
||||
## File: Install-ServiceFabricSDK.ps1
|
||||
## Desc: Install webpicmd and then the service fabric sdk
|
||||
## must be install after Visual Studio
|
||||
################################################################################
|
||||
|
||||
#Creating 'Installer' cache folder if it doesn't exist
|
||||
$temp_install_dir = 'C:\Windows\Installer'
|
||||
New-Item -Path $temp_install_dir -ItemType Directory -Force
|
||||
|
||||
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
|
||||
|
||||
WebpiCmd.exe /Install /Products:MicrosoftAzure-ServiceFabric-CoreSDK /AcceptEula
|
||||
################################################################################
|
||||
## File: Install-ServiceFabricSDK.ps1
|
||||
## Desc: Install webpicmd and then the service fabric sdk
|
||||
## must be install after Visual Studio
|
||||
################################################################################
|
||||
|
||||
#Creating 'Installer' cache folder if it doesn't exist
|
||||
$temp_install_dir = 'C:\Windows\Installer'
|
||||
New-Item -Path $temp_install_dir -ItemType Directory -Force
|
||||
|
||||
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
|
||||
|
||||
WebpiCmd.exe /Install /Products:MicrosoftAzure-ServiceFabric-CoreSDK /AcceptEula /XML:https://webpifeed.blob.core.windows.net/webpifeed/5.1/WebProductList.xml
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
## File: Install-Svn.ps1
|
||||
## Desc: Install Subversion
|
||||
################################################################################
|
||||
|
||||
choco install svn -y
|
||||
################################################################################
|
||||
## File: Install-Svn.ps1
|
||||
## Desc: Install Subversion
|
||||
################################################################################
|
||||
|
||||
choco install svn -y
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
################################################################################
|
||||
## File: Install-TypeScript.ps1
|
||||
## Team: CI Build
|
||||
## Desc: Install Latest TypeScript
|
||||
################################################################################
|
||||
|
||||
npm install -g typescript
|
||||
################################################################################
|
||||
## File: Install-TypeScript.ps1
|
||||
## Desc: Install Latest TypeScript
|
||||
################################################################################
|
||||
|
||||
npm install -g typescript
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
################################################################################
|
||||
## File: Install-Vcpkg.ps1
|
||||
## Desc: Install vcpkg
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$Uri = 'https://github.com/Microsoft/vcpkg.git'
|
||||
$InstallDir = 'C:\vcpkg'
|
||||
$VcpkgExecPath = 'vcpkg.exe'
|
||||
|
||||
git clone --depth=1 $Uri $InstallDir -q
|
||||
|
||||
# Build and integrate vcpkg
|
||||
Invoke-Expression "$InstallDir\bootstrap-vcpkg.bat"
|
||||
Invoke-Expression "$InstallDir\$VcpkgExecPath integrate install"
|
||||
|
||||
# Add vcpkg to system environment
|
||||
Add-MachinePathItem $InstallDir
|
||||
$env:Path = Get-MachinePath
|
||||
setx VCPKG_INSTALLATION_ROOT $InstallDir /M
|
||||
################################################################################
|
||||
## File: Install-Vcpkg.ps1
|
||||
## Desc: Install vcpkg
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$Uri = 'https://github.com/Microsoft/vcpkg.git'
|
||||
$InstallDir = 'C:\vcpkg'
|
||||
$VcpkgExecPath = 'vcpkg.exe'
|
||||
|
||||
git clone --depth=1 $Uri $InstallDir -q
|
||||
|
||||
# Build and integrate vcpkg
|
||||
Invoke-Expression "$InstallDir\bootstrap-vcpkg.bat"
|
||||
Invoke-Expression "$InstallDir\$VcpkgExecPath integrate install"
|
||||
|
||||
# Add vcpkg to system environment
|
||||
Add-MachinePathItem $InstallDir
|
||||
$env:Path = Get-MachinePath
|
||||
setx VCPKG_INSTALLATION_ROOT $InstallDir /M
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
####################################################################################
|
||||
## File: Install-WinAppDriver.ps1
|
||||
## Desc: Install Windows Application Driver (WinAppDriver)
|
||||
####################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
Install-MSI -MsiUrl "https://github.com/Microsoft/WinAppDriver/releases/download/v1.1/WindowsApplicationDriver.msi" -MsiName "WindowsApplicationDriver.msi"
|
||||
####################################################################################
|
||||
## File: Install-WinAppDriver.ps1
|
||||
## Desc: Install Windows Application Driver (WinAppDriver)
|
||||
####################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
Install-MSI -MsiUrl "https://github.com/Microsoft/WinAppDriver/releases/download/v1.1/WindowsApplicationDriver.msi" -MsiName "WindowsApplicationDriver.msi"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
################################################################################
|
||||
## File: Install-WindowsUpdates.ps1
|
||||
## Desc: Install Windows Updates.
|
||||
## Should be run at end just before Antivirus.
|
||||
################################################################################
|
||||
|
||||
Write-Host "Run windows updates"
|
||||
Install-Module -Name PSWindowsUpdate -Force -AllowClobber
|
||||
Get-WUInstall -WindowsUpdate -AcceptAll -UpdateType Software -IgnoreReboot
|
||||
Get-WUInstall -MicrosoftUpdate -AcceptAll -IgnoreUserInput -IgnoreReboot
|
||||
################################################################################
|
||||
## File: Install-WindowsUpdates.ps1
|
||||
## Desc: Install Windows Updates.
|
||||
## Should be run at end just before Antivirus.
|
||||
################################################################################
|
||||
|
||||
Write-Host "Run windows updates"
|
||||
Install-Module -Name PSWindowsUpdate -Force -AllowClobber
|
||||
Get-WUInstall -WindowsUpdate -AcceptAll -UpdateType Software -IgnoreReboot
|
||||
Get-WUInstall -MicrosoftUpdate -AcceptAll -IgnoreUserInput -IgnoreReboot
|
||||
|
||||
@@ -1,156 +1,156 @@
|
||||
################################################################################
|
||||
## File: Update-AndroidSDK.ps1
|
||||
## Desc: Install and update Android SDK and tools
|
||||
################################################################################
|
||||
|
||||
# Download the latest command line tools so that we can accept all of the licenses.
|
||||
# See https://developer.android.com/studio/#command-tools
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip" -OutFile android-sdk-tools.zip
|
||||
|
||||
# Don't replace the one that VS installs as it seems to break things.
|
||||
Expand-Archive -Path android-sdk-tools.zip -DestinationPath android-sdk -Force
|
||||
|
||||
$sdk = Get-Item -Path .\android-sdk
|
||||
|
||||
# Install the standard Android SDK licenses. In the past, there wasn't a better way to do this,
|
||||
# so we are base64-encoding a zip of the licenses directory from another installation.
|
||||
# To create this base64 string, create a zip file that contains nothing but a 'licenses' folder,
|
||||
# which folder contains the accepted license files found in 'C:\Program Files (x86)\Android\android-sdk\licenses'.
|
||||
# Then, run this in PowerShell:
|
||||
# $LicensesZipFileName = 'C:\Program Files (x86)\Android\android-sdk\Licenses.zip'
|
||||
# $base64Content = [Convert]::ToBase64String([IO.File]::ReadAllBytes($LicensesZipFileName))
|
||||
# echo $base64Content
|
||||
#
|
||||
# Future: see if the base64 technique can be avoided by running this PowerShell script to accept all licenses.
|
||||
# This fails when run on a live agent, likely because non-interactive mode is set.
|
||||
# It may work fine during image generation (this script).
|
||||
# for($i=0; $i -lt 100; $i++) { $response += "y`n"}; $response | .\sdkmanager.bat --licenses
|
||||
$base64Content = "UEsDBBQAAAAAAKJeN06amkPzKgAAACoAAAAhAAAAbGljZW5zZXMvYW5kcm9pZC1nb29nbGV0di1saWNlbnNlDQpmYzk0NmU4ZjIzMWYzZTMxNTliZjBiN2M2NTVjOTI0Y2IyZTM4MzMwUEsDBBQAAAAIAKBrN05E+YSqQwAAAFQAAAAcAAAAbGljZW5zZXMvYW5kcm9pZC1zZGstbGljZW5zZQXByREAIQgEwP9WmYsjhxgOKJN/CNs9vmdOQ2zdRw2dxQnWjqQ/3oIgXQM9vqUiwkiX8ljWea4ZlCF3xTo1pz6w+wdQSwMEFAAAAAAAxV43TpECY7AqAAAAKgAAACQAAABsaWNlbnNlcy9hbmRyb2lkLXNkay1wcmV2aWV3LWxpY2Vuc2UNCjUwNDY2N2Y0YzBkZTdhZjFhMDZkZTlmNGIxNzI3Yjg0MzUxZjI5MTBQSwMEFAAAAAAAzF43TpOr0CgqAAAAKgAAABsAAABsaWNlbnNlcy9nb29nbGUtZ2RrLWxpY2Vuc2UNCjMzYjZhMmI2NDYwN2YxMWI3NTlmMzIwZWY5ZGZmNGFlNWM0N2Q5N2FQSwMEFAAAAAAAz143TqxN4xEqAAAAKgAAACQAAABsaWNlbnNlcy9pbnRlbC1hbmRyb2lkLWV4dHJhLWxpY2Vuc2UNCmQ5NzVmNzUxNjk4YTc3YjY2MmYxMjU0ZGRiZWVkMzkwMWU5NzZmNWFQSwMEFAAAAAAA0l43Tu2ee/8qAAAAKgAAACYAAABsaWNlbnNlcy9taXBzLWFuZHJvaWQtc3lzaW1hZ2UtbGljZW5zZQ0KNjNkNzAzZjU2OTJmZDg5MWQ1YWNhY2ZiZDhlMDlmNDBmYzk3NjEwNVBLAQIUABQAAAAAAKJeN06amkPzKgAAACoAAAAhAAAAAAAAAAEAIAAAAAAAAABsaWNlbnNlcy9hbmRyb2lkLWdvb2dsZXR2LWxpY2Vuc2VQSwECFAAUAAAACACgazdORPmEqkMAAABUAAAAHAAAAAAAAAABACAAAABpAAAAbGljZW5zZXMvYW5kcm9pZC1zZGstbGljZW5zZVBLAQIUABQAAAAAAMVeN06RAmOwKgAAACoAAAAkAAAAAAAAAAEAIAAAAOYAAABsaWNlbnNlcy9hbmRyb2lkLXNkay1wcmV2aWV3LWxpY2Vuc2VQSwECFAAUAAAAAADMXjdOk6vQKCoAAAAqAAAAGwAAAAAAAAABACAAAABSAQAAbGljZW5zZXMvZ29vZ2xlLWdkay1saWNlbnNlUEsBAhQAFAAAAAAAz143TqxN4xEqAAAAKgAAACQAAAAAAAAAAQAgAAAAtQEAAGxpY2Vuc2VzL2ludGVsLWFuZHJvaWQtZXh0cmEtbGljZW5zZVBLAQIUABQAAAAAANJeN07tnnv/KgAAACoAAAAmAAAAAAAAAAEAIAAAACECAABsaWNlbnNlcy9taXBzLWFuZHJvaWQtc3lzaW1hZ2UtbGljZW5zZVBLBQYAAAAABgAGANoBAACPAgAAAAA="
|
||||
$content = [System.Convert]::FromBase64String($base64Content)
|
||||
Set-Content -Path .\android-sdk-licenses.zip -Value $content -Encoding Byte
|
||||
Expand-Archive -Path .\android-sdk-licenses.zip -DestinationPath 'C:\Program Files (x86)\Android\android-sdk' -Force
|
||||
|
||||
|
||||
# run the updates.
|
||||
# keep newer versions in descending order
|
||||
|
||||
$sdk_root = "C:\Program Files (x86)\Android\android-sdk"
|
||||
|
||||
# The NDK is installed by Visual Studio at this location:
|
||||
$ndk_root = "C:\Microsoft\AndroidNDK64\"
|
||||
|
||||
if(Test-Path $ndk_root){
|
||||
|
||||
$androidNDKs = Get-ChildItem -Path $ndk_root | Sort-Object -Property Name -Descending | Select-Object -First 1
|
||||
$latestAndroidNDK = $androidNDKs.FullName;
|
||||
|
||||
setx ANDROID_HOME $sdk_root /M
|
||||
setx ANDROID_NDK_HOME $latestAndroidNDK /M
|
||||
setx ANDROID_NDK_PATH $latestAndroidNDK /M
|
||||
}
|
||||
else {
|
||||
Write-Host "NDK is not installed at path $ndk_root"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
Push-Location -Path $sdk.FullName
|
||||
|
||||
& '.\tools\bin\sdkmanager.bat' --sdk_root=$sdk_root `
|
||||
"platform-tools" `
|
||||
"platforms;android-29" `
|
||||
"platforms;android-28" `
|
||||
"platforms;android-27" `
|
||||
"platforms;android-26" `
|
||||
"platforms;android-25" `
|
||||
"platforms;android-24" `
|
||||
"platforms;android-23" `
|
||||
"platforms;android-22" `
|
||||
"platforms;android-21" `
|
||||
"platforms;android-19" `
|
||||
"build-tools;29.0.2" `
|
||||
"build-tools;29.0.0" `
|
||||
"build-tools;28.0.3" `
|
||||
"build-tools;28.0.2" `
|
||||
"build-tools;28.0.1" `
|
||||
"build-tools;28.0.0" `
|
||||
"build-tools;27.0.3" `
|
||||
"build-tools;27.0.2" `
|
||||
"build-tools;27.0.1" `
|
||||
"build-tools;27.0.0" `
|
||||
"build-tools;26.0.3" `
|
||||
"build-tools;26.0.2" `
|
||||
"build-tools;26.0.1" `
|
||||
"build-tools;26.0.0" `
|
||||
"build-tools;25.0.3" `
|
||||
"build-tools;25.0.2" `
|
||||
"build-tools;25.0.1" `
|
||||
"build-tools;25.0.0" `
|
||||
"build-tools;24.0.3" `
|
||||
"build-tools;24.0.2" `
|
||||
"build-tools;24.0.1" `
|
||||
"build-tools;24.0.0" `
|
||||
"build-tools;23.0.3" `
|
||||
"build-tools;23.0.2" `
|
||||
"build-tools;23.0.1" `
|
||||
"build-tools;22.0.1" `
|
||||
"build-tools;21.1.2" `
|
||||
"build-tools;20.0.0" `
|
||||
"build-tools;19.1.0" `
|
||||
"extras;android;m2repository" `
|
||||
"extras;google;m2repository" `
|
||||
"extras;google;google_play_services" `
|
||||
"extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2" `
|
||||
"extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.1" `
|
||||
"extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2" `
|
||||
"extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1" `
|
||||
"add-ons;addon-google_apis-google-24" `
|
||||
"add-ons;addon-google_apis-google-23" `
|
||||
"add-ons;addon-google_apis-google-22" `
|
||||
"add-ons;addon-google_apis-google-21" `
|
||||
"cmake;3.6.4111459" `
|
||||
"patcher;v4"
|
||||
|
||||
Pop-Location
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$Header = @"
|
||||
|
||||
## Android SDK Build Tools
|
||||
|
||||
"@
|
||||
|
||||
Add-ContentToMarkdown -Content $Header
|
||||
|
||||
$BuildTools =(Get-ChildItem "C:\Program Files (x86)\Android\android-sdk\build-tools\") `
|
||||
| Where { $_.Name -match "[0-9].*" } `
|
||||
| Sort-Object -Descending `
|
||||
| % { "#### $($_.Name)`n`n_Location:_ $($_.FullName)`n" }
|
||||
|
||||
Add-ContentToMarkdown -Content $BuildTools
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$Header = @"
|
||||
|
||||
## Android SDK Platforms
|
||||
|
||||
"@
|
||||
|
||||
Add-ContentToMarkdown -Content $Header
|
||||
|
||||
$SdkList =(Get-ChildItem "C:\Program Files (x86)\Android\android-sdk\platforms\") | Sort-Object -Descending | %{ $_.FullName }
|
||||
|
||||
foreach($sdk in $SdkList)
|
||||
{
|
||||
$sdkProps = ConvertFrom-StringData (Get-Content "$sdk\source.properties" -Raw)
|
||||
|
||||
$content = @"
|
||||
#### $($sdkProps.'Platform.Version') (API $($sdkProps.'AndroidVersion.ApiLevel'))
|
||||
|
||||
_Location:_ $sdk
|
||||
|
||||
"@
|
||||
Add-ContentToMarkdown -Content $content
|
||||
}
|
||||
################################################################################
|
||||
## File: Update-AndroidSDK.ps1
|
||||
## Desc: Install and update Android SDK and tools
|
||||
################################################################################
|
||||
|
||||
# Download the latest command line tools so that we can accept all of the licenses.
|
||||
# See https://developer.android.com/studio/#command-tools
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip" -OutFile android-sdk-tools.zip
|
||||
|
||||
# Don't replace the one that VS installs as it seems to break things.
|
||||
Expand-Archive -Path android-sdk-tools.zip -DestinationPath android-sdk -Force
|
||||
|
||||
$sdk = Get-Item -Path .\android-sdk
|
||||
|
||||
# Install the standard Android SDK licenses. In the past, there wasn't a better way to do this,
|
||||
# so we are base64-encoding a zip of the licenses directory from another installation.
|
||||
# To create this base64 string, create a zip file that contains nothing but a 'licenses' folder,
|
||||
# which folder contains the accepted license files found in 'C:\Program Files (x86)\Android\android-sdk\licenses'.
|
||||
# Then, run this in PowerShell:
|
||||
# $LicensesZipFileName = 'C:\Program Files (x86)\Android\android-sdk\Licenses.zip'
|
||||
# $base64Content = [Convert]::ToBase64String([IO.File]::ReadAllBytes($LicensesZipFileName))
|
||||
# echo $base64Content
|
||||
#
|
||||
# Future: see if the base64 technique can be avoided by running this PowerShell script to accept all licenses.
|
||||
# This fails when run on a live agent, likely because non-interactive mode is set.
|
||||
# It may work fine during image generation (this script).
|
||||
# for($i=0; $i -lt 100; $i++) { $response += "y`n"}; $response | .\sdkmanager.bat --licenses
|
||||
$base64Content = "UEsDBBQAAAAAAKJeN06amkPzKgAAACoAAAAhAAAAbGljZW5zZXMvYW5kcm9pZC1nb29nbGV0di1saWNlbnNlDQpmYzk0NmU4ZjIzMWYzZTMxNTliZjBiN2M2NTVjOTI0Y2IyZTM4MzMwUEsDBBQAAAAIAKBrN05E+YSqQwAAAFQAAAAcAAAAbGljZW5zZXMvYW5kcm9pZC1zZGstbGljZW5zZQXByREAIQgEwP9WmYsjhxgOKJN/CNs9vmdOQ2zdRw2dxQnWjqQ/3oIgXQM9vqUiwkiX8ljWea4ZlCF3xTo1pz6w+wdQSwMEFAAAAAAAxV43TpECY7AqAAAAKgAAACQAAABsaWNlbnNlcy9hbmRyb2lkLXNkay1wcmV2aWV3LWxpY2Vuc2UNCjUwNDY2N2Y0YzBkZTdhZjFhMDZkZTlmNGIxNzI3Yjg0MzUxZjI5MTBQSwMEFAAAAAAAzF43TpOr0CgqAAAAKgAAABsAAABsaWNlbnNlcy9nb29nbGUtZ2RrLWxpY2Vuc2UNCjMzYjZhMmI2NDYwN2YxMWI3NTlmMzIwZWY5ZGZmNGFlNWM0N2Q5N2FQSwMEFAAAAAAAz143TqxN4xEqAAAAKgAAACQAAABsaWNlbnNlcy9pbnRlbC1hbmRyb2lkLWV4dHJhLWxpY2Vuc2UNCmQ5NzVmNzUxNjk4YTc3YjY2MmYxMjU0ZGRiZWVkMzkwMWU5NzZmNWFQSwMEFAAAAAAA0l43Tu2ee/8qAAAAKgAAACYAAABsaWNlbnNlcy9taXBzLWFuZHJvaWQtc3lzaW1hZ2UtbGljZW5zZQ0KNjNkNzAzZjU2OTJmZDg5MWQ1YWNhY2ZiZDhlMDlmNDBmYzk3NjEwNVBLAQIUABQAAAAAAKJeN06amkPzKgAAACoAAAAhAAAAAAAAAAEAIAAAAAAAAABsaWNlbnNlcy9hbmRyb2lkLWdvb2dsZXR2LWxpY2Vuc2VQSwECFAAUAAAACACgazdORPmEqkMAAABUAAAAHAAAAAAAAAABACAAAABpAAAAbGljZW5zZXMvYW5kcm9pZC1zZGstbGljZW5zZVBLAQIUABQAAAAAAMVeN06RAmOwKgAAACoAAAAkAAAAAAAAAAEAIAAAAOYAAABsaWNlbnNlcy9hbmRyb2lkLXNkay1wcmV2aWV3LWxpY2Vuc2VQSwECFAAUAAAAAADMXjdOk6vQKCoAAAAqAAAAGwAAAAAAAAABACAAAABSAQAAbGljZW5zZXMvZ29vZ2xlLWdkay1saWNlbnNlUEsBAhQAFAAAAAAAz143TqxN4xEqAAAAKgAAACQAAAAAAAAAAQAgAAAAtQEAAGxpY2Vuc2VzL2ludGVsLWFuZHJvaWQtZXh0cmEtbGljZW5zZVBLAQIUABQAAAAAANJeN07tnnv/KgAAACoAAAAmAAAAAAAAAAEAIAAAACECAABsaWNlbnNlcy9taXBzLWFuZHJvaWQtc3lzaW1hZ2UtbGljZW5zZVBLBQYAAAAABgAGANoBAACPAgAAAAA="
|
||||
$content = [System.Convert]::FromBase64String($base64Content)
|
||||
Set-Content -Path .\android-sdk-licenses.zip -Value $content -Encoding Byte
|
||||
Expand-Archive -Path .\android-sdk-licenses.zip -DestinationPath 'C:\Program Files (x86)\Android\android-sdk' -Force
|
||||
|
||||
|
||||
# run the updates.
|
||||
# keep newer versions in descending order
|
||||
|
||||
$sdk_root = "C:\Program Files (x86)\Android\android-sdk"
|
||||
|
||||
# The NDK is installed by Visual Studio at this location:
|
||||
$ndk_root = "C:\Microsoft\AndroidNDK64\"
|
||||
|
||||
if(Test-Path $ndk_root){
|
||||
|
||||
$androidNDKs = Get-ChildItem -Path $ndk_root | Sort-Object -Property Name -Descending | Select-Object -First 1
|
||||
$latestAndroidNDK = $androidNDKs.FullName;
|
||||
|
||||
setx ANDROID_HOME $sdk_root /M
|
||||
setx ANDROID_NDK_HOME $latestAndroidNDK /M
|
||||
setx ANDROID_NDK_PATH $latestAndroidNDK /M
|
||||
}
|
||||
else {
|
||||
Write-Host "NDK is not installed at path $ndk_root"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
Push-Location -Path $sdk.FullName
|
||||
|
||||
& '.\tools\bin\sdkmanager.bat' --sdk_root=$sdk_root `
|
||||
"platform-tools" `
|
||||
"platforms;android-29" `
|
||||
"platforms;android-28" `
|
||||
"platforms;android-27" `
|
||||
"platforms;android-26" `
|
||||
"platforms;android-25" `
|
||||
"platforms;android-24" `
|
||||
"platforms;android-23" `
|
||||
"platforms;android-22" `
|
||||
"platforms;android-21" `
|
||||
"platforms;android-19" `
|
||||
"build-tools;29.0.2" `
|
||||
"build-tools;29.0.0" `
|
||||
"build-tools;28.0.3" `
|
||||
"build-tools;28.0.2" `
|
||||
"build-tools;28.0.1" `
|
||||
"build-tools;28.0.0" `
|
||||
"build-tools;27.0.3" `
|
||||
"build-tools;27.0.2" `
|
||||
"build-tools;27.0.1" `
|
||||
"build-tools;27.0.0" `
|
||||
"build-tools;26.0.3" `
|
||||
"build-tools;26.0.2" `
|
||||
"build-tools;26.0.1" `
|
||||
"build-tools;26.0.0" `
|
||||
"build-tools;25.0.3" `
|
||||
"build-tools;25.0.2" `
|
||||
"build-tools;25.0.1" `
|
||||
"build-tools;25.0.0" `
|
||||
"build-tools;24.0.3" `
|
||||
"build-tools;24.0.2" `
|
||||
"build-tools;24.0.1" `
|
||||
"build-tools;24.0.0" `
|
||||
"build-tools;23.0.3" `
|
||||
"build-tools;23.0.2" `
|
||||
"build-tools;23.0.1" `
|
||||
"build-tools;22.0.1" `
|
||||
"build-tools;21.1.2" `
|
||||
"build-tools;20.0.0" `
|
||||
"build-tools;19.1.0" `
|
||||
"extras;android;m2repository" `
|
||||
"extras;google;m2repository" `
|
||||
"extras;google;google_play_services" `
|
||||
"extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2" `
|
||||
"extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.1" `
|
||||
"extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2" `
|
||||
"extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1" `
|
||||
"add-ons;addon-google_apis-google-24" `
|
||||
"add-ons;addon-google_apis-google-23" `
|
||||
"add-ons;addon-google_apis-google-22" `
|
||||
"add-ons;addon-google_apis-google-21" `
|
||||
"cmake;3.6.4111459" `
|
||||
"patcher;v4"
|
||||
|
||||
Pop-Location
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$Header = @"
|
||||
|
||||
## Android SDK Build Tools
|
||||
|
||||
"@
|
||||
|
||||
Add-ContentToMarkdown -Content $Header
|
||||
|
||||
$BuildTools =(Get-ChildItem "C:\Program Files (x86)\Android\android-sdk\build-tools\") `
|
||||
| Where { $_.Name -match "[0-9].*" } `
|
||||
| Sort-Object -Descending `
|
||||
| % { "#### $($_.Name)`n`n_Location:_ $($_.FullName)`n" }
|
||||
|
||||
Add-ContentToMarkdown -Content $BuildTools
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$Header = @"
|
||||
|
||||
## Android SDK Platforms
|
||||
|
||||
"@
|
||||
|
||||
Add-ContentToMarkdown -Content $Header
|
||||
|
||||
$SdkList =(Get-ChildItem "C:\Program Files (x86)\Android\android-sdk\platforms\") | Sort-Object -Descending | %{ $_.FullName }
|
||||
|
||||
foreach($sdk in $SdkList)
|
||||
{
|
||||
$sdkProps = ConvertFrom-StringData (Get-Content "$sdk\source.properties" -Raw)
|
||||
|
||||
$content = @"
|
||||
#### $($sdkProps.'Platform.Version') (API $($sdkProps.'AndroidVersion.ApiLevel'))
|
||||
|
||||
_Location:_ $sdk
|
||||
|
||||
"@
|
||||
Add-ContentToMarkdown -Content $content
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
################################################################################
|
||||
## File: Update-DotnetTLS.ps1
|
||||
## Desc: Update DotNetFramework security protocol to TLS 1.2
|
||||
################################################################################
|
||||
|
||||
$registryPath = "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319"
|
||||
$name = "SchUseStrongCrypto"
|
||||
$value = "1"
|
||||
if(Test-Path $registryPath){
|
||||
Set-ItemProperty -Path $registryPath -Name $name -Value $value -Type DWORD
|
||||
}
|
||||
|
||||
$registryPath = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319"
|
||||
if(Test-Path $registryPath){
|
||||
Set-ItemProperty -Path $registryPath -Name $name -Value $value -Type DWORD
|
||||
}
|
||||
|
||||
|
||||
################################################################################
|
||||
## File: Update-DotnetTLS.ps1
|
||||
## Desc: Update DotNetFramework security protocol to TLS 1.2
|
||||
################################################################################
|
||||
|
||||
$registryPath = "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319"
|
||||
$name = "SchUseStrongCrypto"
|
||||
$value = "1"
|
||||
if(Test-Path $registryPath){
|
||||
Set-ItemProperty -Path $registryPath -Name $name -Value $value -Type DWORD
|
||||
}
|
||||
|
||||
$registryPath = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319"
|
||||
if(Test-Path $registryPath){
|
||||
Set-ItemProperty -Path $registryPath -Name $name -Value $value -Type DWORD
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
################################################################################
|
||||
## File: Validate-7zip.ps1
|
||||
## Desc: Validate 7zip
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name '7z')
|
||||
{
|
||||
Write-Host "7zip on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host '7zip is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "7zip"
|
||||
$(7z --help).Split([System.Environment]::NewLine)[1] -match "\d+\.\d+"
|
||||
$7zipVersion = $matches[0]
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $7zipVersion<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-7zip.ps1
|
||||
## Desc: Validate 7zip
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name '7z')
|
||||
{
|
||||
Write-Host "7zip on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host '7zip is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "7zip"
|
||||
$(7z --help).Split([System.Environment]::NewLine)[1] -match "\d+\.\d+"
|
||||
$7zipVersion = $matches[0]
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $7zipVersion<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
################################################################################
|
||||
## File: Validate-AzureCli.ps1
|
||||
## Desc: Validate Azure CLI
|
||||
################################################################################
|
||||
|
||||
if(Get-Command -Name 'az')
|
||||
{
|
||||
Write-Host "Azure Cli $(az --version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Error "Azure Cli not on path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$azureCliVersion = az -v | findstr azure-cli
|
||||
$azureCliVersion = $azureCliVersion.trim().Substring("azure-cli".Length).trim()
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Azure CLI"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $azureCliVersion
|
||||
_Environment:_
|
||||
* PATH: contains location of az.cmd
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-AzureCli.ps1
|
||||
## Desc: Validate Azure CLI
|
||||
################################################################################
|
||||
|
||||
if(Get-Command -Name 'az')
|
||||
{
|
||||
Write-Host "Azure Cli $(az --version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Error "Azure Cli not on path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$azureCliVersion = az -v | findstr azure-cli
|
||||
$azureCliVersion = $azureCliVersion.trim().Substring("azure-cli".Length).trim()
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Azure CLI"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $azureCliVersion
|
||||
_Environment:_
|
||||
* PATH: contains location of az.cmd
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
################################################################################
|
||||
## File: Validate-AzureCosmosDbEmulator.ps1
|
||||
## Desc: Validate Azure CosmosDb Emulator installation.
|
||||
################################################################################
|
||||
|
||||
$SoftwareName = 'Azure CosmosDb Emulator'
|
||||
$regKey = gci HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* | gp | ? { $_.DisplayName -eq 'Azure Cosmos DB Emulator' }
|
||||
|
||||
if ($regKey -eq $null)
|
||||
{
|
||||
Write-Host "The $regKey registry key is not set"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "The $regKey registry key is set"
|
||||
}
|
||||
|
||||
$installDir = $regKey.InstallLocation
|
||||
if ($installDir -eq $null)
|
||||
{
|
||||
Write-Host "The $SoftwareName installation directory registry value is not set"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "The $SoftwareName installation directory registry value is set to: $installDir"
|
||||
}
|
||||
|
||||
$exeFilePath = Join-Path $installDir 'CosmosDB.Emulator.exe'
|
||||
if (!(Test-Path $exeFilePath))
|
||||
{
|
||||
Write-Host "$SoftwareName is not installed"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
{
|
||||
$fileVersion = (Get-Item $exeFilePath).VersionInfo.FileVersion
|
||||
Write-Host "$SoftwareName is successfully installed: $fileVersion"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $fileVersion<br/>
|
||||
_Location:_ $installDir
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
}
|
||||
################################################################################
|
||||
## File: Validate-AzureCosmosDbEmulator.ps1
|
||||
## Desc: Validate Azure CosmosDb Emulator installation.
|
||||
################################################################################
|
||||
|
||||
$SoftwareName = 'Azure CosmosDb Emulator'
|
||||
$regKey = gci HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* | gp | ? { $_.DisplayName -eq 'Azure Cosmos DB Emulator' }
|
||||
|
||||
if ($regKey -eq $null)
|
||||
{
|
||||
Write-Host "The $regKey registry key is not set"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "The $regKey registry key is set"
|
||||
}
|
||||
|
||||
$installDir = $regKey.InstallLocation
|
||||
if ($installDir -eq $null)
|
||||
{
|
||||
Write-Host "The $SoftwareName installation directory registry value is not set"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "The $SoftwareName installation directory registry value is set to: $installDir"
|
||||
}
|
||||
|
||||
$exeFilePath = Join-Path $installDir 'CosmosDB.Emulator.exe'
|
||||
if (!(Test-Path $exeFilePath))
|
||||
{
|
||||
Write-Host "$SoftwareName is not installed"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
{
|
||||
$fileVersion = (Get-Item $exeFilePath).VersionInfo.FileVersion
|
||||
Write-Host "$SoftwareName is successfully installed: $fileVersion"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $fileVersion<br/>
|
||||
_Location:_ $installDir
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
}
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
################################################################################
|
||||
## File: Validate-AzureDevOpsCli.ps1
|
||||
## Desc: Validate Azure DevOps CLI
|
||||
################################################################################
|
||||
|
||||
az devops -h
|
||||
|
||||
if($LastExitCode -ne 0)
|
||||
{
|
||||
Write-Error "Azure DevOps Cli extension not present"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Azure DevOps Cli extension is present"
|
||||
}
|
||||
|
||||
$azDevopsVer = az -v | findstr azure-devops
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $azDevopsVer
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName 'Azure DevOps Cli extension' -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-AzureDevOpsCli.ps1
|
||||
## Desc: Validate Azure DevOps CLI
|
||||
################################################################################
|
||||
|
||||
az devops -h
|
||||
|
||||
if($LastExitCode -ne 0)
|
||||
{
|
||||
Write-Error "Azure DevOps Cli extension not present"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Azure DevOps Cli extension is present"
|
||||
}
|
||||
|
||||
$azDevopsVer = az -v | findstr azure-devops
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $azDevopsVer
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName 'Azure DevOps Cli extension' -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,71 +1,71 @@
|
||||
################################################################################
|
||||
## File: Validate-AzureModules.ps1
|
||||
## Desc: Validate Azure PowerShell modules
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$DefaultModule = Get-Module -Name AzureRM -ListAvailable | Select-Object -First 1
|
||||
|
||||
$env:PSModulePath = $env:PSModulePath + ";C:\Modules"
|
||||
|
||||
$azureModules = Get-Module -Name Azure -ListAvailable | Select-Object Name,Version,Path | Format-Table | Out-String
|
||||
|
||||
Write-Host "The Azure Modules finally present are:"
|
||||
$azureModules
|
||||
|
||||
if( ($azureModules -match "2.1.0") -and ($azureModules -match "3.8.0") -and ($azureModules -match "4.2.1") -and ($azureModules -match "5.1.1"))
|
||||
{
|
||||
Write-Host "Required Azure modules are present"
|
||||
}
|
||||
else {
|
||||
Write-Host "One or more required Azure modules are not present"
|
||||
throw "One or more required Azure modules are not present."
|
||||
}
|
||||
|
||||
|
||||
$azureRMModules = Get-Module -Name AzureRM -ListAvailable | Select-Object Name,Version,Path | Format-Table | Out-String
|
||||
|
||||
Write-Host "The AzureRM Modules finally present are:"
|
||||
$azureRMModules
|
||||
|
||||
if( ($azureRMModules -match "2.1.0") -and ($azureRMModules -match "3.8.0") -and ($azureRMModules -match "4.2.1") -and ($azureRMModules -match "5.1.1"))
|
||||
{
|
||||
Write-Host "Required AzureRM modules are present"
|
||||
|
||||
}
|
||||
else {
|
||||
Write-Host "One or more required AzureRM modules are not present"
|
||||
throw "One or more required AzureRM modules are not present."
|
||||
}
|
||||
|
||||
|
||||
$azureModules = Get-Module -Name AzureRM -ListAvailable
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Azure/AzureRM Powershell modules"
|
||||
|
||||
$Description = @"
|
||||
#### $($DefaultModule.Version)
|
||||
|
||||
This version is installed and is available via `Get-Module -ListAvailable`
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
foreach( $module in $azureModules)
|
||||
{
|
||||
if($module.Version -ne $DefaultModule.Version)
|
||||
{
|
||||
|
||||
$CurrentModule = @"
|
||||
#### $($module.Version)
|
||||
|
||||
This version is saved but not installed
|
||||
_Location:_ $($module.Path)
|
||||
|
||||
"@
|
||||
Add-ContentToMarkdown -Content $CurrentModule
|
||||
}
|
||||
}
|
||||
################################################################################
|
||||
## File: Validate-AzureModules.ps1
|
||||
## Desc: Validate Azure PowerShell modules
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$DefaultModule = Get-Module -Name AzureRM -ListAvailable | Select-Object -First 1
|
||||
|
||||
$env:PSModulePath = $env:PSModulePath + ";C:\Modules"
|
||||
|
||||
$azureModules = Get-Module -Name Azure -ListAvailable | Select-Object Name,Version,Path | Format-Table | Out-String
|
||||
|
||||
Write-Host "The Azure Modules finally present are:"
|
||||
$azureModules
|
||||
|
||||
if( ($azureModules -match "2.1.0") -and ($azureModules -match "3.8.0") -and ($azureModules -match "4.2.1") -and ($azureModules -match "5.1.1"))
|
||||
{
|
||||
Write-Host "Required Azure modules are present"
|
||||
}
|
||||
else {
|
||||
Write-Host "One or more required Azure modules are not present"
|
||||
throw "One or more required Azure modules are not present."
|
||||
}
|
||||
|
||||
|
||||
$azureRMModules = Get-Module -Name AzureRM -ListAvailable | Select-Object Name,Version,Path | Format-Table | Out-String
|
||||
|
||||
Write-Host "The AzureRM Modules finally present are:"
|
||||
$azureRMModules
|
||||
|
||||
if( ($azureRMModules -match "2.1.0") -and ($azureRMModules -match "3.8.0") -and ($azureRMModules -match "4.2.1") -and ($azureRMModules -match "5.1.1"))
|
||||
{
|
||||
Write-Host "Required AzureRM modules are present"
|
||||
|
||||
}
|
||||
else {
|
||||
Write-Host "One or more required AzureRM modules are not present"
|
||||
throw "One or more required AzureRM modules are not present."
|
||||
}
|
||||
|
||||
|
||||
$azureModules = Get-Module -Name AzureRM -ListAvailable
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Azure/AzureRM Powershell modules"
|
||||
|
||||
$Description = @"
|
||||
#### $($DefaultModule.Version)
|
||||
|
||||
This version is installed and is available via `Get-Module -ListAvailable`
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
foreach( $module in $azureModules)
|
||||
{
|
||||
if($module.Version -ne $DefaultModule.Version)
|
||||
{
|
||||
|
||||
$CurrentModule = @"
|
||||
#### $($module.Version)
|
||||
|
||||
This version is saved but not installed
|
||||
_Location:_ $($module.Path)
|
||||
|
||||
"@
|
||||
Add-ContentToMarkdown -Content $CurrentModule
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,75 +1,75 @@
|
||||
################################################################################
|
||||
## File: Validate-Boost.ps1
|
||||
## Desc: Validate Boost
|
||||
################################################################################
|
||||
|
||||
function Validate-BoostVersion
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$BoostRootPath,
|
||||
[String]$BoostRelease
|
||||
)
|
||||
|
||||
$ReleasePath = Join-Path -Path $BoostRootPath -ChildPath $BoostRelease
|
||||
|
||||
if ((Test-Path "$ReleasePath\b2.exe") -and (Test-Path "$ReleasePath\bjam.exe"))
|
||||
{
|
||||
Write-Host "Boost.Build $BoostRelease is successfully installed"
|
||||
Write-Host "Boost.Jam $BoostRelease is successfully installed"
|
||||
return
|
||||
}
|
||||
|
||||
Write-Host "$BoostRelease not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Verify that Boost is on the path
|
||||
if ((Get-Command -Name 'b2') -and (Get-Command -Name 'bjam'))
|
||||
{
|
||||
Write-Host "Boost is on the path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Boost is not on the path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$tmplMark = @"
|
||||
#### {0}
|
||||
|
||||
_Environment:_
|
||||
* {1}: root directory of the Boost version {0} installation
|
||||
|
||||
"@
|
||||
|
||||
$tmplMarkRoot = @"
|
||||
#### {0}
|
||||
|
||||
* PATH: contains the location of Boost version {0}
|
||||
* BOOST_ROOT: root directory of the Boost version {0} installation
|
||||
* {1}: root directory of the Boost version {0} installation
|
||||
"@
|
||||
|
||||
$SoftwareName = 'Boost'
|
||||
$Description = New-Object System.Text.StringBuilder
|
||||
$BoostRootDirectory = Join-Path -Path $env:ProgramFiles -ChildPath "Boost"
|
||||
$BoostVersionsToInstall = $env:BOOST_VERSIONS.split(",")
|
||||
|
||||
foreach($Boost in $BoostVersionsToInstall)
|
||||
{
|
||||
Validate-BoostVersion -BoostRootPath $BoostRootDirectory -BoostRelease $Boost
|
||||
$BoostVersionTag = "BOOST_ROOT_{0}" -f $Boost.Replace('.', '_')
|
||||
|
||||
if($boost -eq $env:BOOST_DEFAULT)
|
||||
{
|
||||
$null = $Description.AppendLine(($tmplMarkRoot -f $BoostVersion, $BoostVersionTag))
|
||||
}
|
||||
else
|
||||
{
|
||||
$null = $Description.AppendLine(($tmplMark -f $BoostVersion, $BoostVersionTag))
|
||||
}
|
||||
}
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description.ToString()
|
||||
################################################################################
|
||||
## File: Validate-Boost.ps1
|
||||
## Desc: Validate Boost
|
||||
################################################################################
|
||||
|
||||
function Validate-BoostVersion
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$BoostRootPath,
|
||||
[String]$BoostRelease
|
||||
)
|
||||
|
||||
$ReleasePath = Join-Path -Path $BoostRootPath -ChildPath $BoostRelease
|
||||
|
||||
if ((Test-Path "$ReleasePath\b2.exe") -and (Test-Path "$ReleasePath\bjam.exe"))
|
||||
{
|
||||
Write-Host "Boost.Build $BoostRelease is successfully installed"
|
||||
Write-Host "Boost.Jam $BoostRelease is successfully installed"
|
||||
return
|
||||
}
|
||||
|
||||
Write-Host "$BoostRelease not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Verify that Boost is on the path
|
||||
if ((Get-Command -Name 'b2') -and (Get-Command -Name 'bjam'))
|
||||
{
|
||||
Write-Host "Boost is on the path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Boost is not on the path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$tmplMark = @"
|
||||
#### {0}
|
||||
|
||||
_Environment:_
|
||||
* {1}: root directory of the Boost version {0} installation
|
||||
|
||||
"@
|
||||
|
||||
$tmplMarkRoot = @"
|
||||
#### {0}
|
||||
|
||||
* PATH: contains the location of Boost version {0}
|
||||
* BOOST_ROOT: root directory of the Boost version {0} installation
|
||||
* {1}: root directory of the Boost version {0} installation
|
||||
"@
|
||||
|
||||
$SoftwareName = 'Boost'
|
||||
$Description = New-Object System.Text.StringBuilder
|
||||
$BoostRootDirectory = Join-Path -Path $env:ProgramFiles -ChildPath "Boost"
|
||||
$BoostVersionsToInstall = $env:BOOST_VERSIONS.split(",")
|
||||
|
||||
foreach($Boost in $BoostVersionsToInstall)
|
||||
{
|
||||
Validate-BoostVersion -BoostRootPath $BoostRootDirectory -BoostRelease $Boost
|
||||
$BoostVersionTag = "BOOST_ROOT_{0}" -f $Boost.Replace('.', '_')
|
||||
|
||||
if($boost -eq $env:BOOST_DEFAULT)
|
||||
{
|
||||
$null = $Description.AppendLine(($tmplMarkRoot -f $BoostVersion, $BoostVersionTag))
|
||||
}
|
||||
else
|
||||
{
|
||||
$null = $Description.AppendLine(($tmplMark -f $BoostVersion, $BoostVersionTag))
|
||||
}
|
||||
}
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description.ToString()
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
################################################################################
|
||||
## File: Validate-Chrome.ps1
|
||||
## Desc: Validate Google Chrome installation.
|
||||
################################################################################
|
||||
|
||||
if(Test-Path "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe")
|
||||
{
|
||||
(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe').'(Default)').VersionInfo
|
||||
|
||||
$SoftwareName = "Google Chrome"
|
||||
$fileVersion = (Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe').'(Default)').VersionInfo.FileVersion
|
||||
$Description = @"
|
||||
_version:_
|
||||
$fileVersion
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
exit 0
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Google Chrome is not installed."
|
||||
exit 1
|
||||
}
|
||||
################################################################################
|
||||
## File: Validate-Chrome.ps1
|
||||
## Desc: Validate Google Chrome installation.
|
||||
################################################################################
|
||||
|
||||
if(Test-Path "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe")
|
||||
{
|
||||
(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe').'(Default)').VersionInfo
|
||||
|
||||
$SoftwareName = "Google Chrome"
|
||||
$fileVersion = (Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe').'(Default)').VersionInfo.FileVersion
|
||||
$Description = @"
|
||||
_version:_
|
||||
$fileVersion
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
exit 0
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Google Chrome is not installed."
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
################################################################################
|
||||
## File: Validate-CloudFoundryCli.ps1
|
||||
## Desc: Validate Cloud Foundry CLI
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'cf')
|
||||
{
|
||||
Write-Host "cf on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'cf is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Cloud Foundry CLI"
|
||||
|
||||
if( $(cf version) -match '\d+\.\d+\.\d+' )
|
||||
{
|
||||
$version = $Matches[0]
|
||||
}
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-CloudFoundryCli.ps1
|
||||
## Desc: Validate Cloud Foundry CLI
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'cf')
|
||||
{
|
||||
Write-Host "cf on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'cf is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Cloud Foundry CLI"
|
||||
|
||||
if( $(cf version) -match '\d+\.\d+\.\d+' )
|
||||
{
|
||||
$version = $Matches[0]
|
||||
}
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
################################################################################
|
||||
## File: Validate-Cmake.ps1
|
||||
## Desc: Validate Cmake
|
||||
################################################################################
|
||||
|
||||
if(Get-Command -Name 'cmake')
|
||||
{
|
||||
Write-Host "Cmake $(cmake -version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'cmake not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
if( $( $(cmake -version) | Out-String) -match 'cmake version (?<version>.*).*' )
|
||||
{
|
||||
$cmakeVersion = $Matches.version.Trim()
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Cmake"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $cmakeVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of cmake.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-Cmake.ps1
|
||||
## Desc: Validate Cmake
|
||||
################################################################################
|
||||
|
||||
if(Get-Command -Name 'cmake')
|
||||
{
|
||||
Write-Host "Cmake $(cmake -version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'cmake not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
if( $( $(cmake -version) | Out-String) -match 'cmake version (?<version>.*).*' )
|
||||
{
|
||||
$cmakeVersion = $Matches.version.Trim()
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Cmake"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $cmakeVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of cmake.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
####################################################################################
|
||||
## File: Validate-DACFx.ps1
|
||||
## Desc: Validate SQL Server® Data-Tier Application Framework (DACFx) for Windows
|
||||
####################################################################################
|
||||
|
||||
$env:PATH = $env:Path + ';C:\Program Files\Microsoft SQL Server\120\DAC\bin;C:\Program Files\Microsoft SQL Server\130\DAC\bin;C:\Program Files\Microsoft SQL Server\140\DAC\bin;C:\Program Files\Microsoft SQL Server\150\DAC\bin'
|
||||
|
||||
if(Get-Command -Name 'SqlPackage')
|
||||
{
|
||||
|
||||
Write-Host "DACFx is installed at path" (Get-Command -Name 'SqlPackage').Source
|
||||
}
|
||||
else
|
||||
{
|
||||
throw "DACFx is not installed!"
|
||||
}
|
||||
|
||||
function Get-DacFxVersion
|
||||
{
|
||||
$regKey = "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Data-Tier Application Framework\CurrentVersion"
|
||||
$Version = (Get-ItemProperty -Path $regKey).'(Default)'
|
||||
return $Version
|
||||
}
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "SQL Server Data Tier Application Framework (x64)"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $(Get-DacFxVersion)<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
####################################################################################
|
||||
## File: Validate-DACFx.ps1
|
||||
## Desc: Validate SQL Server® Data-Tier Application Framework (DACFx) for Windows
|
||||
####################################################################################
|
||||
|
||||
$env:PATH = $env:Path + ';C:\Program Files\Microsoft SQL Server\120\DAC\bin;C:\Program Files\Microsoft SQL Server\130\DAC\bin;C:\Program Files\Microsoft SQL Server\140\DAC\bin;C:\Program Files\Microsoft SQL Server\150\DAC\bin'
|
||||
|
||||
if(Get-Command -Name 'SqlPackage')
|
||||
{
|
||||
|
||||
Write-Host "DACFx is installed at path" (Get-Command -Name 'SqlPackage').Source
|
||||
}
|
||||
else
|
||||
{
|
||||
throw "DACFx is not installed!"
|
||||
}
|
||||
|
||||
function Get-DacFxVersion
|
||||
{
|
||||
$regKey = "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Data-Tier Application Framework\CurrentVersion"
|
||||
$Version = (Get-ItemProperty -Path $regKey).'(Default)'
|
||||
return $Version
|
||||
}
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "SQL Server Data Tier Application Framework (x64)"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $(Get-DacFxVersion)<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
################################################################################
|
||||
## File: Validate-Docker.ps1
|
||||
## Desc: Validate Docker.
|
||||
################################################################################
|
||||
|
||||
|
||||
if((Get-Command -Name 'docker') -and (Get-Command -Name 'docker-compose'))
|
||||
{
|
||||
Write-Host "docker $(docker version) on path"
|
||||
Write-Host "docker-compose $(docker-compose version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "docker or docker-compose are not on path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Docker"
|
||||
|
||||
$version = $(docker version --format '{{.Server.Version}}')
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of docker.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
|
||||
|
||||
$SoftwareName = "Docker-compose"
|
||||
|
||||
if( $(docker-compose --version) -match 'docker-compose version (?<version>.*), build.*' )
|
||||
{
|
||||
$dockerComposeVersion = $Matches.version
|
||||
}
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $dockerComposeVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of docker-compose.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-Docker.ps1
|
||||
## Desc: Validate Docker.
|
||||
################################################################################
|
||||
|
||||
|
||||
if((Get-Command -Name 'docker') -and (Get-Command -Name 'docker-compose'))
|
||||
{
|
||||
Write-Host "docker $(docker version) on path"
|
||||
Write-Host "docker-compose $(docker-compose version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "docker or docker-compose are not on path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Docker"
|
||||
|
||||
$version = $(docker version --format '{{.Server.Version}}')
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of docker.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
|
||||
|
||||
$SoftwareName = "Docker-compose"
|
||||
|
||||
if( $(docker-compose --version) -match 'docker-compose version (?<version>.*), build.*' )
|
||||
{
|
||||
$dockerComposeVersion = $Matches.version
|
||||
}
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $dockerComposeVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of docker-compose.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
################################################################################
|
||||
## File: Validate-DotnetSDK.ps1
|
||||
## Desc: Validate dotnet
|
||||
################################################################################
|
||||
|
||||
if(Get-Command -Name 'dotnet')
|
||||
{
|
||||
Write-Host "dotnet $(dotnet --version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "dotnet is not on path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = ".NET Core"
|
||||
|
||||
$Description = @"
|
||||
The following runtimes and SDKs are installed:
|
||||
|
||||
_Environment:_
|
||||
* PATH: contains location of dotnet.exe
|
||||
|
||||
_SDK:_
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
$SdkList =(Get-ChildItem "C:\Program Files\dotnet\sdk") | Where { $_.Name -match "[0-9].*" } | Sort-Object -Descending | % { "* $($_.Name) $($_.FullName)" }
|
||||
|
||||
Add-ContentToMarkdown -Content $SdkList
|
||||
|
||||
|
||||
|
||||
$Runtimes = @"
|
||||
|
||||
_Runtime:_
|
||||
"@
|
||||
|
||||
Add-ContentToMarkdown -Content $Runtimes
|
||||
|
||||
$RuntimeList =(Get-ChildItem "C:\Program Files\dotnet\shared\Microsoft.NETCore.App") | Where { $_.Name -match "[0-9].*" } | Sort-Object -Descending | % { "* $($_.Name) $($_.FullName)" }
|
||||
|
||||
Add-ContentToMarkdown -Content $RuntimeList
|
||||
|
||||
################################################################################
|
||||
## File: Validate-DotnetSDK.ps1
|
||||
## Desc: Validate dotnet
|
||||
################################################################################
|
||||
|
||||
if(Get-Command -Name 'dotnet')
|
||||
{
|
||||
Write-Host "dotnet $(dotnet --version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "dotnet is not on path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = ".NET Core"
|
||||
|
||||
$Description = @"
|
||||
The following runtimes and SDKs are installed:
|
||||
|
||||
_Environment:_
|
||||
* PATH: contains location of dotnet.exe
|
||||
|
||||
_SDK:_
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
$SdkList =(Get-ChildItem "C:\Program Files\dotnet\sdk") | Where { $_.Name -match "[0-9].*" } | Sort-Object -Descending | % { "* $($_.Name) $($_.FullName)" }
|
||||
|
||||
Add-ContentToMarkdown -Content $SdkList
|
||||
|
||||
|
||||
|
||||
$Runtimes = @"
|
||||
|
||||
_Runtime:_
|
||||
"@
|
||||
|
||||
Add-ContentToMarkdown -Content $Runtimes
|
||||
|
||||
$RuntimeList =(Get-ChildItem "C:\Program Files\dotnet\shared\Microsoft.NETCore.App") | Where { $_.Name -match "[0-9].*" } | Sort-Object -Descending | % { "* $($_.Name) $($_.FullName)" }
|
||||
|
||||
Add-ContentToMarkdown -Content $RuntimeList
|
||||
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
################################################################################
|
||||
## File: Validate-DotnetTLS.ps1
|
||||
## Desc: Validate DotNetFramework security protocol to TLS 1.2
|
||||
################################################################################
|
||||
|
||||
$protocols = [Net.ServicePointManager]::SecurityProtocol
|
||||
$protocolArr = $protocols -split ', '
|
||||
if($protocolArr.Contains('Tls12'))
|
||||
{
|
||||
Write-Host "Tls 1.2 has been enabled."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Tls 1.2 has not been enabled."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "TLS12"
|
||||
$version = "1.2";
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
_Description:_ .NET has been configured to use TLS 1.2 by default
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
################################################################################
|
||||
## File: Validate-DotnetTLS.ps1
|
||||
## Desc: Validate DotNetFramework security protocol to TLS 1.2
|
||||
################################################################################
|
||||
|
||||
$protocols = [Net.ServicePointManager]::SecurityProtocol
|
||||
$protocolArr = $protocols -split ', '
|
||||
if($protocolArr.Contains('Tls12'))
|
||||
{
|
||||
Write-Host "Tls 1.2 has been enabled."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Tls 1.2 has not been enabled."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "TLS12"
|
||||
$version = "1.2";
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
_Description:_ .NET has been configured to use TLS 1.2 by default
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
################################################################################
|
||||
## File: Validate-Firefox.ps1
|
||||
## Desc: Validate Mozilla Firefox installation.
|
||||
################################################################################
|
||||
|
||||
if(Test-Path "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe")
|
||||
{
|
||||
(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe').'(Default)').VersionInfo
|
||||
|
||||
$fileVersion = (Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe').'(Default)').VersionInfo.FileVersion
|
||||
$SoftwareName = "Mozilla Firefox"
|
||||
$Description = @"
|
||||
_version:_
|
||||
$fileVersion
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
exit 0
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Mozilla Firefox is not installed."
|
||||
exit 1
|
||||
}
|
||||
################################################################################
|
||||
## File: Validate-Firefox.ps1
|
||||
## Desc: Validate Mozilla Firefox installation.
|
||||
################################################################################
|
||||
|
||||
if(Test-Path "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe")
|
||||
{
|
||||
(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe').'(Default)').VersionInfo
|
||||
|
||||
$fileVersion = (Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe').'(Default)').VersionInfo.FileVersion
|
||||
$SoftwareName = "Mozilla Firefox"
|
||||
$Description = @"
|
||||
_version:_
|
||||
$fileVersion
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
exit 0
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Mozilla Firefox is not installed."
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
################################################################################
|
||||
## File: Validate-Git.ps1
|
||||
## Desc: Validate Git for Windows
|
||||
################################################################################
|
||||
|
||||
if((Get-Command -Name 'git') -and (Get-Command -Name 'bash') -and (Get-Command -Name 'awk') -and (Get-Command -Name 'git-lfs'))
|
||||
{
|
||||
Write-Host "$(git version) on path"
|
||||
Write-Host "$(git-lfs version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "git or git-lfs are not on path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
if( $(git version) -match 'git version (?<version>.*).win.*' )
|
||||
{
|
||||
$gitVersion = $Matches.version
|
||||
}
|
||||
|
||||
if( $(git-lfs version) -match 'git-lfs\/(?<version>.*) \(Git.*' )
|
||||
{
|
||||
$gitLfsVersion = $Matches.version
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Git"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $gitVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of git.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Git Large File Storage (LFS)"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $gitLfsVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of git-lfs.exe
|
||||
* GIT_LFS_PATH: location of git-lfs.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-Git.ps1
|
||||
## Desc: Validate Git for Windows
|
||||
################################################################################
|
||||
|
||||
if((Get-Command -Name 'git') -and (Get-Command -Name 'bash') -and (Get-Command -Name 'awk') -and (Get-Command -Name 'git-lfs'))
|
||||
{
|
||||
Write-Host "$(git version) on path"
|
||||
Write-Host "$(git-lfs version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "git or git-lfs are not on path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
if( $(git version) -match 'git version (?<version>.*).win.*' )
|
||||
{
|
||||
$gitVersion = $Matches.version
|
||||
}
|
||||
|
||||
if( $(git-lfs version) -match 'git-lfs\/(?<version>.*) \(Git.*' )
|
||||
{
|
||||
$gitLfsVersion = $Matches.version
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Git"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $gitVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of git.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Git Large File Storage (LFS)"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $gitLfsVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of git-lfs.exe
|
||||
* GIT_LFS_PATH: location of git-lfs.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
################################################################################
|
||||
## File: Validate-GitVersion.ps1
|
||||
## Desc: Validate GitVersion
|
||||
################################################################################
|
||||
|
||||
$command = Get-Command -Name 'gitversion'
|
||||
if ($command)
|
||||
{
|
||||
Write-Host "gitversion on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'gitversion is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "GitVersion"
|
||||
$version = $command.Version.ToString()
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-GitVersion.ps1
|
||||
## Desc: Validate GitVersion
|
||||
################################################################################
|
||||
|
||||
$command = Get-Command -Name 'gitversion'
|
||||
if ($command)
|
||||
{
|
||||
Write-Host "gitversion on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'gitversion is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "GitVersion"
|
||||
$version = $command.Version.ToString()
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,70 +1,70 @@
|
||||
################################################################################
|
||||
## File: Validate-Go.ps1
|
||||
## Desc: Validate Go
|
||||
################################################################################
|
||||
|
||||
# Function that gets the version of Go at the specified path
|
||||
function Get-GoVersion
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$goRootPath
|
||||
)
|
||||
|
||||
$env:Path = "$goRootPath\bin;" + $env:Path
|
||||
if( $(go version) -match 'go version go(?<version>.*) win.*' )
|
||||
{
|
||||
$goVersion = $Matches.version
|
||||
return $goVersion
|
||||
}
|
||||
|
||||
Write-Host "Unable to determine Go version at " + $goRootPath
|
||||
return ""
|
||||
}
|
||||
|
||||
# Verify that go.exe is on the path
|
||||
if(Get-Command -Name 'go')
|
||||
{
|
||||
Write-Host "$(go version) is on the path."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Go is not on the path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Add details of available versions in Markdown
|
||||
$tmplMark = @"
|
||||
#### {0}
|
||||
|
||||
_Environment:_
|
||||
* {1}: root directory of the Go {0} installation
|
||||
|
||||
"@
|
||||
|
||||
$tmplMarkRoot = @"
|
||||
#### {0}
|
||||
|
||||
_Environment:_
|
||||
* PATH: contains the location of go.exe version {0}
|
||||
* GOROOT: root directory of the Go {0} installation
|
||||
* {1}: root directory of the Go {0} installation
|
||||
"@
|
||||
|
||||
$SoftwareName = "Go (x64)"
|
||||
$Description = New-Object System.Text.StringBuilder
|
||||
$goVersionsToInstall = $env:GO_VERSIONS.split(",")
|
||||
|
||||
foreach($go in $goVersionsToInstall) {
|
||||
$goVersion = Get-GoVersion -goRootPath "C:\Go${go}"
|
||||
$goVersionTag = "GOROOT_{0}_{1}_X64" -f $go.split(".")
|
||||
if ($goVersion -eq $go) {
|
||||
if($go -eq $env:GO_DEFAULT) {
|
||||
$null = $Description.AppendLine(($tmplMarkRoot -f $goVersion, $goVersionTag))
|
||||
} else {
|
||||
$null = $Description.AppendLine(($tmplMark -f $goVersion, $goVersionTag))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description.ToString()
|
||||
################################################################################
|
||||
## File: Validate-Go.ps1
|
||||
## Desc: Validate Go
|
||||
################################################################################
|
||||
|
||||
# Function that gets the version of Go at the specified path
|
||||
function Get-GoVersion
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$goRootPath
|
||||
)
|
||||
|
||||
$env:Path = "$goRootPath\bin;" + $env:Path
|
||||
if( $(go version) -match 'go version go(?<version>.*) win.*' )
|
||||
{
|
||||
$goVersion = $Matches.version
|
||||
return $goVersion
|
||||
}
|
||||
|
||||
Write-Host "Unable to determine Go version at " + $goRootPath
|
||||
return ""
|
||||
}
|
||||
|
||||
# Verify that go.exe is on the path
|
||||
if(Get-Command -Name 'go')
|
||||
{
|
||||
Write-Host "$(go version) is on the path."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Go is not on the path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Add details of available versions in Markdown
|
||||
$tmplMark = @"
|
||||
#### {0}
|
||||
|
||||
_Environment:_
|
||||
* {1}: root directory of the Go {0} installation
|
||||
|
||||
"@
|
||||
|
||||
$tmplMarkRoot = @"
|
||||
#### {0}
|
||||
|
||||
_Environment:_
|
||||
* PATH: contains the location of go.exe version {0}
|
||||
* GOROOT: root directory of the Go {0} installation
|
||||
* {1}: root directory of the Go {0} installation
|
||||
"@
|
||||
|
||||
$SoftwareName = "Go (x64)"
|
||||
$Description = New-Object System.Text.StringBuilder
|
||||
$goVersionsToInstall = $env:GO_VERSIONS.split(",")
|
||||
|
||||
foreach($go in $goVersionsToInstall) {
|
||||
$goVersion = Get-GoVersion -goRootPath "C:\Go${go}"
|
||||
$goVersionTag = "GOROOT_{0}_{1}_X64" -f $go.split(".")
|
||||
if ($goVersion -eq $go) {
|
||||
if($go -eq $env:GO_DEFAULT) {
|
||||
$null = $Description.AppendLine(($tmplMarkRoot -f $goVersion, $goVersionTag))
|
||||
} else {
|
||||
$null = $Description.AppendLine(($tmplMark -f $goVersion, $goVersionTag))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description.ToString()
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
################################################################################
|
||||
## File: Validate-InnoSetup.ps1
|
||||
## Desc: Validate Inno Setup
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'iscc')
|
||||
{
|
||||
Write-Host "iscc is on PATH"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "iscc is not on PATH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Inno Setup"
|
||||
|
||||
$ChocoList = $(choco list --local-only innosetup) | Select-String -Pattern "InnoSetup"
|
||||
$ChocoList -Match "\d+\.\d+\.\d+"
|
||||
$Version = $Matches[0]
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $Version<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-InnoSetup.ps1
|
||||
## Desc: Validate Inno Setup
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'iscc')
|
||||
{
|
||||
Write-Host "iscc is on PATH"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "iscc is not on PATH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Inno Setup"
|
||||
|
||||
$ChocoList = $(choco list --local-only innosetup) | Select-String -Pattern "InnoSetup"
|
||||
$ChocoList -Match "\d+\.\d+\.\d+"
|
||||
$Version = $Matches[0]
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $Version<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,113 +1,113 @@
|
||||
################################################################################
|
||||
## File: Validate-JavaTools.ps1
|
||||
## Desc: Validate various JDKs and java tools
|
||||
################################################################################
|
||||
|
||||
if((Get-Command -Name 'java') -and (Get-Command -Name 'mvn') -and (Get-Command -Name 'ant') -and (Get-Command -Name 'gradle'))
|
||||
{
|
||||
Write-Host "Java $(java -version) on path"
|
||||
Write-Host "Maven $(mvn -version) on path"
|
||||
Write-Host "Ant $(ant -version) on path"
|
||||
Write-Host "Gradle $(gradle -version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "one of Java,Maven,Ant,Gradle is not on path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
if( $( $(& $env:comspec "/s /c java -version 2>&1") | Out-String) -match '^(?<vendor>.+) version "(?<version>.+)".*' )
|
||||
{
|
||||
$javaVersion = $Matches.version
|
||||
}
|
||||
|
||||
$env:Path = $env:JAVA_HOME_7_X64 + "\bin;" + $env:Path
|
||||
|
||||
if( $( $(& $env:comspec "/s /c java -version 2>&1") | Out-String) -match '^(?<vendor>.+) version "(?<version>.+)".*' )
|
||||
{
|
||||
$java7Version = $Matches.version
|
||||
}
|
||||
|
||||
$env:Path = $env:JAVA_HOME_11_X64 + "\bin;" + $env:Path
|
||||
|
||||
if( $( $(& $env:comspec "/s /c java -version 2>&1") | Out-String) -match '^(?<vendor>.+) version "(?<version>.+)".*' )
|
||||
{
|
||||
$java11Version = $Matches.version
|
||||
}
|
||||
|
||||
|
||||
if( $(ant -version) -match 'Apache Ant\(TM\) version (?<version>.*) compiled.*' )
|
||||
{
|
||||
$antVersion = $Matches.version
|
||||
}
|
||||
|
||||
if( $( $(mvn -version) | Out-String) -match 'Apache Maven (?<version>.*) \(.*' )
|
||||
{
|
||||
$mvnVersion = $Matches.version
|
||||
}
|
||||
|
||||
if( $( $(gradle -version) | Out-String) -match 'Gradle (?<version>.*)' )
|
||||
{
|
||||
$gradleVersion = $Matches.version.Trim()
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Java Development Kit"
|
||||
|
||||
$Description = @"
|
||||
#### $javaVersion
|
||||
|
||||
_Environment:_
|
||||
* JAVA_HOME: location of JDK
|
||||
* PATH: contains bin folder of JDK
|
||||
|
||||
#### $java7Version
|
||||
|
||||
_Location:_ $env:JAVA_HOME_7_X64
|
||||
|
||||
#### $java11Version
|
||||
|
||||
_Location:_ $env:JAVA_HOME_11_X64
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Ant"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $antVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of ant.cmd
|
||||
* ANT_HOME: location of ant.cmd
|
||||
* COBERTURA_HOME: location of cobertura-2.1.1.jar
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Maven"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $mvnVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of mvn.bat
|
||||
* M2_HOME: Maven installation root
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Gradle"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $gradleVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of gradle
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-JavaTools.ps1
|
||||
## Desc: Validate various JDKs and java tools
|
||||
################################################################################
|
||||
|
||||
if((Get-Command -Name 'java') -and (Get-Command -Name 'mvn') -and (Get-Command -Name 'ant') -and (Get-Command -Name 'gradle'))
|
||||
{
|
||||
Write-Host "Java $(java -version) on path"
|
||||
Write-Host "Maven $(mvn -version) on path"
|
||||
Write-Host "Ant $(ant -version) on path"
|
||||
Write-Host "Gradle $(gradle -version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "one of Java,Maven,Ant,Gradle is not on path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
if( $( $(& $env:comspec "/s /c java -version 2>&1") | Out-String) -match '^(?<vendor>.+) version "(?<version>.+)".*' )
|
||||
{
|
||||
$javaVersion = $Matches.version
|
||||
}
|
||||
|
||||
$env:Path = $env:JAVA_HOME_7_X64 + "\bin;" + $env:Path
|
||||
|
||||
if( $( $(& $env:comspec "/s /c java -version 2>&1") | Out-String) -match '^(?<vendor>.+) version "(?<version>.+)".*' )
|
||||
{
|
||||
$java7Version = $Matches.version
|
||||
}
|
||||
|
||||
$env:Path = $env:JAVA_HOME_11_X64 + "\bin;" + $env:Path
|
||||
|
||||
if( $( $(& $env:comspec "/s /c java -version 2>&1") | Out-String) -match '^(?<vendor>.+) version "(?<version>.+)".*' )
|
||||
{
|
||||
$java11Version = $Matches.version
|
||||
}
|
||||
|
||||
|
||||
if( $(ant -version) -match 'Apache Ant\(TM\) version (?<version>.*) compiled.*' )
|
||||
{
|
||||
$antVersion = $Matches.version
|
||||
}
|
||||
|
||||
if( $( $(mvn -version) | Out-String) -match 'Apache Maven (?<version>.*) \(.*' )
|
||||
{
|
||||
$mvnVersion = $Matches.version
|
||||
}
|
||||
|
||||
if( $( $(gradle -version) | Out-String) -match 'Gradle (?<version>.*)' )
|
||||
{
|
||||
$gradleVersion = $Matches.version.Trim()
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Java Development Kit"
|
||||
|
||||
$Description = @"
|
||||
#### $javaVersion
|
||||
|
||||
_Environment:_
|
||||
* JAVA_HOME: location of JDK
|
||||
* PATH: contains bin folder of JDK
|
||||
|
||||
#### $java7Version
|
||||
|
||||
_Location:_ $env:JAVA_HOME_7_X64
|
||||
|
||||
#### $java11Version
|
||||
|
||||
_Location:_ $env:JAVA_HOME_11_X64
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Ant"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $antVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of ant.cmd
|
||||
* ANT_HOME: location of ant.cmd
|
||||
* COBERTURA_HOME: location of cobertura-2.1.1.jar
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Maven"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $mvnVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of mvn.bat
|
||||
* M2_HOME: Maven installation root
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Gradle"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $gradleVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of gradle
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
################################################################################
|
||||
## File: Validate-Jq.ps1
|
||||
## Desc: Validate jq
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'jq')
|
||||
{
|
||||
Write-Host "jq on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'jq is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "jq"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $(jq --version)<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-Jq.ps1
|
||||
## Desc: Validate jq
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'jq')
|
||||
{
|
||||
Write-Host "jq on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'jq is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "jq"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $(jq --version)<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
################################################################################
|
||||
## File: Validate-Kind.ps1
|
||||
## Desc: Validate Kind.
|
||||
################################################################################
|
||||
|
||||
|
||||
if((Get-Command -Name 'kind'))
|
||||
{
|
||||
Write-Host "kind $(kind version) in path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "kind is not in path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Kind"
|
||||
|
||||
$version = $(kind version)
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of kind.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-Kind.ps1
|
||||
## Desc: Validate Kind.
|
||||
################################################################################
|
||||
|
||||
|
||||
if((Get-Command -Name 'kind'))
|
||||
{
|
||||
Write-Host "kind $(kind version) in path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "kind is not in path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Kind"
|
||||
|
||||
$version = $(kind version)
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of kind.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
################################################################################
|
||||
## File: Validate-KubernetesCli.ps1
|
||||
## Desc: Validate KubernetesCli.
|
||||
################################################################################
|
||||
|
||||
|
||||
if((Get-Command -Name 'kubectl'))
|
||||
{
|
||||
Write-Host "kubectl $(kubectl version --client=true --short=true) in path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "kubectl is not in path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Kubectl"
|
||||
|
||||
$version = $(kubectl version --client=true --short=true)
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of kubectl.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-KubernetesCli.ps1
|
||||
## Desc: Validate KubernetesCli.
|
||||
################################################################################
|
||||
|
||||
|
||||
if((Get-Command -Name 'kubectl'))
|
||||
{
|
||||
Write-Host "kubectl $(kubectl version --client=true --short=true) in path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "kubectl is not in path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Kubectl"
|
||||
|
||||
$version = $(kubectl version --client=true --short=true)
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of kubectl.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
################################################################################
|
||||
## File: Validate-Mercurial.ps1
|
||||
## Desc: Validate Mercurial
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'hg')
|
||||
{
|
||||
Write-Host "Mercurial on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'Mercurial is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Mercurial"
|
||||
$(hg --version).Split([System.Environment]::NewLine)[0] -match "\d+\.\d+\.\d+"
|
||||
$MercurialVersion = $matches[0]
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $MercurialVersion<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-Mercurial.ps1
|
||||
## Desc: Validate Mercurial
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'hg')
|
||||
{
|
||||
Write-Host "Mercurial on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'Mercurial is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Mercurial"
|
||||
$(hg --version).Split([System.Environment]::NewLine)[0] -match "\d+\.\d+\.\d+"
|
||||
$MercurialVersion = $matches[0]
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $MercurialVersion<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,57 +1,57 @@
|
||||
################################################################################
|
||||
## File: Validate-MinGW.ps1
|
||||
## Desc: Validate MinGW
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'gcc')
|
||||
{
|
||||
Write-Host "gcc is successfully installed:"
|
||||
gcc --version | Write-Host
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "gcc is not on PATH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if (Get-Command -Name 'g++')
|
||||
{
|
||||
Write-Host "g++ is successfully installed:"
|
||||
g++ --version | Write-Host
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "g++ is not on PATH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if (Get-Command -Name 'make')
|
||||
{
|
||||
Write-Host "make is successfully installed:"
|
||||
make --version | Write-Host
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "make is not on PATH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
|
||||
# `gcc --version` gives output like:
|
||||
# gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 5.3.0
|
||||
# Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
# This is free software; see the source for copying conditions. There is NO
|
||||
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
$SoftwareName = "MinGW"
|
||||
$(gcc --version).Split([System.Environment]::NewLine)[0] -match "\d\.\d\.\d$"
|
||||
$minGwVersion = $matches[0]
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $minGwVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of the MinGW 'bin' directory
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-MinGW.ps1
|
||||
## Desc: Validate MinGW
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'gcc')
|
||||
{
|
||||
Write-Host "gcc is successfully installed:"
|
||||
gcc --version | Write-Host
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "gcc is not on PATH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if (Get-Command -Name 'g++')
|
||||
{
|
||||
Write-Host "g++ is successfully installed:"
|
||||
g++ --version | Write-Host
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "g++ is not on PATH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if (Get-Command -Name 'make')
|
||||
{
|
||||
Write-Host "make is successfully installed:"
|
||||
make --version | Write-Host
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "make is not on PATH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
|
||||
# `gcc --version` gives output like:
|
||||
# gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 5.3.0
|
||||
# Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
# This is free software; see the source for copying conditions. There is NO
|
||||
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
$SoftwareName = "MinGW"
|
||||
$(gcc --version).Split([System.Environment]::NewLine)[0] -match "\d\.\d\.\d$"
|
||||
$minGwVersion = $matches[0]
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $minGwVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of the MinGW 'bin' directory
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
################################################################################
|
||||
## File: Validate-Miniconda.ps1
|
||||
## Desc: Validate Miniconda
|
||||
################################################################################
|
||||
|
||||
if ($env:CONDA)
|
||||
{
|
||||
Write-Host "The CONDA environment variable is set"
|
||||
Write-Host $env:CONDA
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "The CONDA environment variable is not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ((Test-Path "$env:CONDA\python.exe") -and (Test-Path "$env:CONDA\Scripts\conda.exe"))
|
||||
{
|
||||
Write-Host "Miniconda is successfully installed:"
|
||||
& "$env:CONDA\Scripts\conda.exe" --version | Write-Host
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Miniconda is not installed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$softwareName = "Miniconda"
|
||||
$description = @"
|
||||
_Version:_ $(& "$env:CONDA\Scripts\conda.exe" --version)<br/>
|
||||
_Environment:_
|
||||
* CONDA: contains location of the root of the Miniconda installation
|
||||
"@
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $softwareName -DescriptionMarkdown $description
|
||||
################################################################################
|
||||
## File: Validate-Miniconda.ps1
|
||||
## Desc: Validate Miniconda
|
||||
################################################################################
|
||||
|
||||
if ($env:CONDA)
|
||||
{
|
||||
Write-Host "The CONDA environment variable is set"
|
||||
Write-Host $env:CONDA
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "The CONDA environment variable is not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ((Test-Path "$env:CONDA\python.exe") -and (Test-Path "$env:CONDA\Scripts\conda.exe"))
|
||||
{
|
||||
Write-Host "Miniconda is successfully installed:"
|
||||
& "$env:CONDA\Scripts\conda.exe" --version | Write-Host
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Miniconda is not installed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$softwareName = "Miniconda"
|
||||
$description = @"
|
||||
_Version:_ $(& "$env:CONDA\Scripts\conda.exe" --version)<br/>
|
||||
_Environment:_
|
||||
* CONDA: contains location of the root of the Miniconda installation
|
||||
"@
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $softwareName -DescriptionMarkdown $description
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
################################################################################
|
||||
## File: Validate-MysqlCli.ps1
|
||||
## Desc: Validate Mysql Cli
|
||||
################################################################################
|
||||
|
||||
$command = Get-Command -Name 'mysql'
|
||||
if($command)
|
||||
{
|
||||
Write-Host "Mysql is on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'Mysql not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Mysql"
|
||||
$version = $command.Version.ToString();
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of mysql.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-MysqlCli.ps1
|
||||
## Desc: Validate Mysql Cli
|
||||
################################################################################
|
||||
|
||||
$command = Get-Command -Name 'mysql'
|
||||
if($command)
|
||||
{
|
||||
Write-Host "Mysql is on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'Mysql not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Mysql"
|
||||
$version = $command.Version.ToString();
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of mysql.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
################################################################################
|
||||
## File: Validate-NET472.ps1
|
||||
## Desc: Validate .NET 4.7.2
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
# For reference, visit https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed#ps_a
|
||||
if(Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Release | ForEach-Object { $_ -ge 461814 })
|
||||
{
|
||||
$version = Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Version
|
||||
Write-Host "Installed .Net version " $version
|
||||
}
|
||||
else {
|
||||
Write-Host ".Net 472 not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = ".NET 4.7.2"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-NET472.ps1
|
||||
## Desc: Validate .NET 4.7.2
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
# For reference, visit https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed#ps_a
|
||||
if(Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Release | ForEach-Object { $_ -ge 461814 })
|
||||
{
|
||||
$version = Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Version
|
||||
Write-Host "Installed .Net version " $version
|
||||
}
|
||||
else {
|
||||
Write-Host ".Net 472 not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = ".NET 4.7.2"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
################################################################################
|
||||
## File: Validate-NET48.ps1
|
||||
## Desc: Validate .NET 4.8
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
# For reference, visit https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed#ps_a
|
||||
if(Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Release | ForEach-Object { $_ -ge 528049 })
|
||||
{
|
||||
$version = Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Version
|
||||
Write-Host "Installed .Net version " $version
|
||||
}
|
||||
else {
|
||||
Write-Host ".Net 48 not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = ".NET 4.8"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-NET48.ps1
|
||||
## Desc: Validate .NET 4.8
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
# For reference, visit https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed#ps_a
|
||||
if(Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Release | ForEach-Object { $_ -ge 528049 })
|
||||
{
|
||||
$version = Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Version
|
||||
Write-Host "Installed .Net version " $version
|
||||
}
|
||||
else {
|
||||
Write-Host ".Net 48 not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = ".NET 4.8"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
################################################################################
|
||||
## File: Validate-NSIS.ps1
|
||||
## Desc: Validate NSIS installation.
|
||||
################################################################################
|
||||
|
||||
$SoftwareName = 'Nullsoft Install System (NSIS)'
|
||||
|
||||
if (Get-Command -Name makensis)
|
||||
{
|
||||
Write-Host "$SoftwareName is installed"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "$SoftwareName is not installed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$ChocoList = $(choco list --local-only nsis) | Select-String -Pattern "nsis" | Select-Object -First 1
|
||||
|
||||
if ($ChocoList -Match "\d+\.\d+")
|
||||
{
|
||||
$Version = $Matches[0]
|
||||
}
|
||||
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $Version<br/>
|
||||
"@
|
||||
|
||||
#Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
Write-Host $description
|
||||
################################################################################
|
||||
## File: Validate-NSIS.ps1
|
||||
## Desc: Validate NSIS installation.
|
||||
################################################################################
|
||||
|
||||
$SoftwareName = 'Nullsoft Install System (NSIS)'
|
||||
|
||||
if (Get-Command -Name makensis)
|
||||
{
|
||||
Write-Host "$SoftwareName is installed"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "$SoftwareName is not installed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$ChocoList = $(choco list --local-only nsis) | Select-String -Pattern "nsis" | Select-Object -First 1
|
||||
|
||||
if ($ChocoList -Match "\d+\.\d+")
|
||||
{
|
||||
$Version = $Matches[0]
|
||||
}
|
||||
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $Version<br/>
|
||||
"@
|
||||
|
||||
#Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
Write-Host $description
|
||||
|
||||
@@ -1,71 +1,68 @@
|
||||
################################################################################
|
||||
## File: Validate-NodeLts.ps1
|
||||
## Desc: Validate nodejs-lts and other common node tools.
|
||||
################################################################################
|
||||
|
||||
if((Get-Command -Name 'node') -and (Get-Command -Name 'npm'))
|
||||
{
|
||||
Write-Host "Node $(node --version) on path"
|
||||
Write-Host "Npm $(npm -version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Node or npm is not on path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if((Get-Command -Name 'gulp') -and (Get-Command -Name 'grunt') -and (Get-Command -Name 'bower') -and (Get-Command -Name 'cordova') -and (Get-Command -Name 'yarn'))
|
||||
{
|
||||
Write-Host "Gulp $(gulp -version) on path"
|
||||
Write-Host "Grunt $(grunt -version) on path"
|
||||
Write-Host "Bower $(bower -version) on path"
|
||||
Write-Host "Yarn $(yarn -version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "One of Gulp, Grunt, Bower, Cordova, or Yarn is not on the path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( $(node --version) -match 'v(?<version>.*)' )
|
||||
{
|
||||
$nodeVersion = $Matches.version
|
||||
$nodeArch = $(node -e "console.log(process.arch)")
|
||||
}
|
||||
|
||||
$npmVersion = $(npm -version)
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Node.js"
|
||||
$GulpInfo = "Gulp $(gulp -version)"
|
||||
$GruntInfo = "Grunt $(grunt -version)"
|
||||
$BowerInfo = "Bower $(bower -version)"
|
||||
$YarnInfo = "Yarn $(yarn -version)"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $nodeVersion<br/>
|
||||
_Architecture:_ $nodeArch<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of node.exe<br/>
|
||||
* $GulpInfo<br/>
|
||||
* $GruntInfo<br/>
|
||||
* $BowerInfo<br/>
|
||||
* $YarnInfo<br/>
|
||||
|
||||
> Note: You can install and use another version of Node.js on Microsoft-hosted agent pools using the [Node tool installer](https://docs.microsoft.com/vsts/pipelines/tasks/tool/node-js) task.
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "npm"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $npmVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of npm.cmd
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-NodeLts.ps1
|
||||
## Desc: Validate nodejs-lts and other common node tools.
|
||||
################################################################################
|
||||
|
||||
if((Get-Command -Name 'node') -and (Get-Command -Name 'npm'))
|
||||
{
|
||||
Write-Host "Node $(node --version) on path"
|
||||
Write-Host "Npm $(npm -version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Node or npm is not on path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if((Get-Command -Name 'gulp') -and (Get-Command -Name 'grunt') -and (Get-Command -Name 'cordova') -and (Get-Command -Name 'yarn'))
|
||||
{
|
||||
Write-Host "Gulp $(gulp -version) on path"
|
||||
Write-Host "Grunt $(grunt -version) on path"
|
||||
Write-Host "Yarn $(yarn -version) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "One of Gulp, Grunt, Cordova, or Yarn is not on the path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( $(node --version) -match 'v(?<version>.*)' )
|
||||
{
|
||||
$nodeVersion = $Matches.version
|
||||
$nodeArch = $(node -e "console.log(process.arch)")
|
||||
}
|
||||
|
||||
$npmVersion = $(npm -version)
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Node.js"
|
||||
$GulpInfo = "Gulp $(gulp -version)"
|
||||
$GruntInfo = "Grunt $(grunt -version)"
|
||||
$YarnInfo = "Yarn $(yarn -version)"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $nodeVersion<br/>
|
||||
_Architecture:_ $nodeArch<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of node.exe<br/>
|
||||
* $GulpInfo<br/>
|
||||
* $GruntInfo<br/>
|
||||
* $YarnInfo<br/>
|
||||
|
||||
> Note: You can install and use another version of Node.js on Microsoft-hosted agent pools using the [Node tool installer](https://docs.microsoft.com/vsts/pipelines/tasks/tool/node-js) task.
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "npm"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $npmVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of npm.cmd
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
################################################################################
|
||||
## File: Validate-OpenSSL.ps1
|
||||
## Desc: Validate openssl
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'openssl')
|
||||
{
|
||||
Write-Host "openssl on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'openssl is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "OpenSSL"
|
||||
|
||||
$versions = Get-Command openssl -All
|
||||
foreach ($version in $versions)
|
||||
{
|
||||
$command = "& `"$($version.Source)`" version"
|
||||
if ( $(Invoke-Expression -Command $command) -match '\d+\.\d+\.\d+\w?' )
|
||||
{
|
||||
$Description += "_Version:_ $($Matches[0]) at $($version.Source)<br/>"
|
||||
}
|
||||
}
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-OpenSSL.ps1
|
||||
## Desc: Validate openssl
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'openssl')
|
||||
{
|
||||
Write-Host "openssl on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'openssl is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "OpenSSL"
|
||||
|
||||
$versions = Get-Command openssl -All
|
||||
foreach ($version in $versions)
|
||||
{
|
||||
$command = "& `"$($version.Source)`" version"
|
||||
if ( $(Invoke-Expression -Command $command) -match '\d+\.\d+\.\d+\w?' )
|
||||
{
|
||||
$Description += "_Version:_ $($Matches[0]) at $($version.Source)<br/>"
|
||||
}
|
||||
}
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
################################################################################
|
||||
## File: Validate-PHP.ps1
|
||||
## Desc: Validate PHP
|
||||
################################################################################
|
||||
|
||||
# Function that gets the version of php at the specified path
|
||||
function Get-PHPVersion
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$phpRootPath
|
||||
)
|
||||
|
||||
$env:Path = "$phpRootPath;" + $env:Path
|
||||
if($($(php --version)| Out-String) -match 'PHP (?<version>.*) (.*cli).*')
|
||||
{
|
||||
$phpVersion = $Matches.version
|
||||
return $phpVersion
|
||||
}
|
||||
|
||||
Write-Host "Unable to determine PHP version at " + $phpRootPath
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Verify that php.exe is on the path
|
||||
if(Get-Command -Name 'php')
|
||||
{
|
||||
Write-Host "$(php --version) is on the path."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "php is not on the path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Get available versions of PHP
|
||||
$phpVersionOnPath = Get-PHPVersion -phpRootPath "C:\tools\php72"
|
||||
|
||||
# Add details of available versions in Markdown
|
||||
$SoftwareName = "PHP (x64)"
|
||||
$Description = @"
|
||||
#### $phpVersionOnPath
|
||||
|
||||
_Environment:_
|
||||
* PATH: contains the location of php.exe version $phpVersionOnPath
|
||||
* PHPROOT: root directory of the PHP $phpVersionOnPath installation
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-PHP.ps1
|
||||
## Desc: Validate PHP
|
||||
################################################################################
|
||||
|
||||
# Function that gets the version of php at the specified path
|
||||
function Get-PHPVersion
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$phpRootPath
|
||||
)
|
||||
|
||||
$env:Path = "$phpRootPath;" + $env:Path
|
||||
if($($(php --version)| Out-String) -match 'PHP (?<version>.*) (.*cli).*')
|
||||
{
|
||||
$phpVersion = $Matches.version
|
||||
return $phpVersion
|
||||
}
|
||||
|
||||
Write-Host "Unable to determine PHP version at " + $phpRootPath
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Verify that php.exe is on the path
|
||||
if(Get-Command -Name 'php')
|
||||
{
|
||||
Write-Host "$(php --version) is on the path."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "php is not on the path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Get available versions of PHP
|
||||
$phpVersionOnPath = Get-PHPVersion -phpRootPath "C:\tools\php72"
|
||||
|
||||
# Add details of available versions in Markdown
|
||||
$SoftwareName = "PHP (x64)"
|
||||
$Description = @"
|
||||
#### $phpVersionOnPath
|
||||
|
||||
_Environment:_
|
||||
* PATH: contains the location of php.exe version $phpVersionOnPath
|
||||
* PHPROOT: root directory of the PHP $phpVersionOnPath installation
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
################################################################################
|
||||
## File: Validate-Perl.ps1
|
||||
## Desc: Validate perl
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'perl')
|
||||
{
|
||||
Write-Host "perl on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'perl is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Perl"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $(perl -e 'print $^V')<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-Perl.ps1
|
||||
## Desc: Validate perl
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'perl')
|
||||
{
|
||||
Write-Host "perl on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'perl is not on path'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Perl"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $(perl -e 'print $^V')<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
################################################################################
|
||||
## File: Validate-PowershellCore.ps1
|
||||
## Desc: Validate Powershell Core
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'pwsh')
|
||||
{
|
||||
Write-Host "pwsh is on PATH"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "pwsh is not on PATH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Powershell Core"
|
||||
|
||||
if(($(pwsh --version) | Out-String) -match 'PowerShell (?<version>.*)')
|
||||
{
|
||||
$PowershellVersion = $Matches.version
|
||||
}
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $PowershellVersion<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-PowershellCore.ps1
|
||||
## Desc: Validate Powershell Core
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'pwsh')
|
||||
{
|
||||
Write-Host "pwsh is on PATH"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "pwsh is not on PATH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Powershell Core"
|
||||
|
||||
if(($(pwsh --version) | Out-String) -match 'PowerShell (?<version>.*)')
|
||||
{
|
||||
$PowershellVersion = $Matches.version
|
||||
}
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $PowershellVersion<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
################################################################################
|
||||
## File: Validate-Python.ps1
|
||||
## Desc: Configure python on path based on what is installed in the tools cache
|
||||
## Must run after tools cache is downloaded and validated
|
||||
################################################################################
|
||||
|
||||
if(Get-Command -Name 'python')
|
||||
{
|
||||
Write-Host "Python $(& python -V 2>&1) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Python is not on path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$Python3Version = $(& python -V 2>&1)
|
||||
|
||||
if ($Python3Version -notlike "Python 3.*")
|
||||
{
|
||||
Write-Error "Python 3 is not in the PATH"
|
||||
}
|
||||
|
||||
|
||||
$python2path = $Env:AGENT_TOOLSDIRECTORY + '/Python/2.7*/x64'
|
||||
$python2Dir = Get-Item -Path $python2path
|
||||
|
||||
$env:Path = $python2Dir.FullName + ";" + $env:Path
|
||||
|
||||
$Python2Version = & $env:comspec "/s /c python --version 2>&1"
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Python (64 bit)"
|
||||
|
||||
$Description = @"
|
||||
#### $Python3Version
|
||||
_Environment:_
|
||||
* PATH: contains location of python.exe
|
||||
|
||||
#### $Python2Version
|
||||
|
||||
_Location:_ $Python2Path
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-Python.ps1
|
||||
## Desc: Configure python on path based on what is installed in the tools cache
|
||||
## Must run after tools cache is downloaded and validated
|
||||
################################################################################
|
||||
|
||||
if(Get-Command -Name 'python')
|
||||
{
|
||||
Write-Host "Python $(& python -V 2>&1) on path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Python is not on path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$Python3Version = $(& python -V 2>&1)
|
||||
|
||||
if ($Python3Version -notlike "Python 3.*")
|
||||
{
|
||||
Write-Error "Python 3 is not in the PATH"
|
||||
}
|
||||
|
||||
|
||||
$python2path = $Env:AGENT_TOOLSDIRECTORY + '/Python/2.7*/x64'
|
||||
$python2Dir = Get-Item -Path $python2path
|
||||
|
||||
$env:Path = $python2Dir.FullName + ";" + $env:Path
|
||||
|
||||
$Python2Version = & $env:comspec "/s /c python --version 2>&1"
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Python (64 bit)"
|
||||
|
||||
$Description = @"
|
||||
#### $Python3Version
|
||||
_Environment:_
|
||||
* PATH: contains location of python.exe
|
||||
|
||||
#### $Python2Version
|
||||
|
||||
_Location:_ $Python2Path
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
################################################################################
|
||||
## File: Validate-Ruby.ps1
|
||||
## Desc: Verify that Ruby is on the path and output version information.
|
||||
################################################################################
|
||||
|
||||
# Function that gets the version of Ruby at the specified path
|
||||
function Get-RubyVersion
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$rubyRootPath
|
||||
)
|
||||
|
||||
# Prepend to the path like: C:\hostedtoolcache\windows\Ruby\2.5.0\x64\bin
|
||||
$env:Path = "$rubyRootPath;" + $env:Path
|
||||
|
||||
# Extract the version from Ruby output like: ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]
|
||||
if( $(ruby --version) -match 'ruby (?<version>.*) \(.*' )
|
||||
{
|
||||
$rubyVersion = $Matches.version
|
||||
return $rubyVersion
|
||||
}
|
||||
|
||||
Write-Host "Unable to determine Ruby version at " + $rubyRootPath
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Verify that ruby is on the path
|
||||
if(Get-Command -Name 'ruby')
|
||||
{
|
||||
Write-Host "$(ruby --version) is on the path."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Ruby is not on the path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Default Ruby Version on Path
|
||||
$rubyExeOnPath = (Get-Command -Name 'ruby').Path
|
||||
$rubyBinOnPath = Split-Path -Path $rubyExeOnPath
|
||||
$rubyVersionOnPath = Get-RubyVersion -rubyRootPath $rubyBinOnPath
|
||||
|
||||
# Add details of available versions in Markdown
|
||||
$SoftwareName = "Ruby (x64)"
|
||||
$Description = @"
|
||||
#### $rubyVersionOnPath
|
||||
_Environment:_
|
||||
* Location: $rubyBinOnPath
|
||||
* PATH: contains the location of ruby.exe version $rubyVersionOnPath
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-Ruby.ps1
|
||||
## Desc: Verify that Ruby is on the path and output version information.
|
||||
################################################################################
|
||||
|
||||
# Function that gets the version of Ruby at the specified path
|
||||
function Get-RubyVersion
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$rubyRootPath
|
||||
)
|
||||
|
||||
# Prepend to the path like: C:\hostedtoolcache\windows\Ruby\2.5.0\x64\bin
|
||||
$env:Path = "$rubyRootPath;" + $env:Path
|
||||
|
||||
# Extract the version from Ruby output like: ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]
|
||||
if( $(ruby --version) -match 'ruby (?<version>.*) \(.*' )
|
||||
{
|
||||
$rubyVersion = $Matches.version
|
||||
return $rubyVersion
|
||||
}
|
||||
|
||||
Write-Host "Unable to determine Ruby version at " + $rubyRootPath
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Verify that ruby is on the path
|
||||
if(Get-Command -Name 'ruby')
|
||||
{
|
||||
Write-Host "$(ruby --version) is on the path."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Ruby is not on the path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Default Ruby Version on Path
|
||||
$rubyExeOnPath = (Get-Command -Name 'ruby').Path
|
||||
$rubyBinOnPath = Split-Path -Path $rubyExeOnPath
|
||||
$rubyVersionOnPath = Get-RubyVersion -rubyRootPath $rubyBinOnPath
|
||||
|
||||
# Add details of available versions in Markdown
|
||||
$SoftwareName = "Ruby (x64)"
|
||||
$Description = @"
|
||||
#### $rubyVersionOnPath
|
||||
_Environment:_
|
||||
* Location: $rubyBinOnPath
|
||||
* PATH: contains the location of ruby.exe version $rubyVersionOnPath
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
################################################################################
|
||||
## File: Validate-Rust.ps1
|
||||
## Desc: Verify that Rust is on the path and output version information.
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'rustc')
|
||||
{
|
||||
Push-Location -Path $env:UserProfile
|
||||
New-Item -Name ".rustup" -Value "C:\Rust\.rustup" -ItemType Junction
|
||||
New-Item -Name ".cargo" -Value "C:\Rust\.cargo" -ItemType Junction
|
||||
$RustcVersion = rustc --version
|
||||
Write-Host "$RustcVersion is on the path"
|
||||
Pop-Location
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "rustc is not on the path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$RustPath = Split-Path (Get-Command -Name 'rustc').Path
|
||||
$RustcVersion -Match "\d+\.\d+\.\d+" | Out-Null
|
||||
$Version = $Matches[0]
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Rust (64-bit)"
|
||||
$Description = @"
|
||||
#### $Version
|
||||
_Location:_ $RustPath
|
||||
_Environment:_
|
||||
* PATH: contains the location of rustc.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-Rust.ps1
|
||||
## Desc: Verify that Rust is on the path and output version information.
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'rustc')
|
||||
{
|
||||
Push-Location -Path $env:UserProfile
|
||||
New-Item -Name ".rustup" -Value "C:\Rust\.rustup" -ItemType Junction
|
||||
New-Item -Name ".cargo" -Value "C:\Rust\.cargo" -ItemType Junction
|
||||
$RustcVersion = rustc --version
|
||||
Write-Host "$RustcVersion is on the path"
|
||||
Pop-Location
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "rustc is not on the path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$RustPath = Split-Path (Get-Command -Name 'rustc').Path
|
||||
$RustcVersion -Match "\d+\.\d+\.\d+" | Out-Null
|
||||
$Version = $Matches[0]
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Rust (64-bit)"
|
||||
$Description = @"
|
||||
#### $Version
|
||||
_Location:_ $RustPath
|
||||
_Environment:_
|
||||
* PATH: contains the location of rustc.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
# Validate the installation
|
||||
$env:PSModulePath = Get-SystemVariable "PSModulePath"
|
||||
$modules = Get-Module -Name SQLPS -ListAvailable
|
||||
Write-Host "The SQLPS Modules present are:"
|
||||
$modules | Select-Object Name,Version,Path | Format-Table
|
||||
|
||||
if ($modules) {
|
||||
$sqlPSVersion = $modules.Version
|
||||
}
|
||||
|
||||
# Validate the SQLserver PS module installation
|
||||
$modules = Get-Module -Name SQLServer -ListAvailable
|
||||
Write-Host "The SQLServer Modules present are:"
|
||||
$modules | Select-Object Name,Version,Path | Format-Table
|
||||
|
||||
if ($modules) {
|
||||
$sqlServerPSModuleVersion = $modules.Version
|
||||
}
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "SQLPS"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $sqlPSVersion
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "SQLServer PS"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $sqlServerPSModuleVersion
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
# Validate the installation
|
||||
$env:PSModulePath = Get-SystemVariable "PSModulePath"
|
||||
$modules = Get-Module -Name SQLPS -ListAvailable
|
||||
Write-Host "The SQLPS Modules present are:"
|
||||
$modules | Select-Object Name,Version,Path | Format-Table
|
||||
|
||||
if ($modules) {
|
||||
$sqlPSVersion = $modules.Version
|
||||
}
|
||||
|
||||
# Validate the SQLserver PS module installation
|
||||
$modules = Get-Module -Name SQLServer -ListAvailable
|
||||
Write-Host "The SQLServer Modules present are:"
|
||||
$modules | Select-Object Name,Version,Path | Format-Table
|
||||
|
||||
if ($modules) {
|
||||
$sqlServerPSModuleVersion = $modules.Version
|
||||
}
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "SQLPS"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $sqlPSVersion
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "SQLServer PS"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $sqlServerPSModuleVersion
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
################################################################################
|
||||
## File: Validate-Sbt.ps1
|
||||
## Team: CI-Platform
|
||||
## Desc: Validate sbt for Windows
|
||||
################################################################################
|
||||
|
||||
if((Get-Command -Name 'sbt'))
|
||||
{
|
||||
Write-Host "sbt is on the path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "sbt is not on path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# This works around issue where sbt --script-version does some copies and breaks the build
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName "sbt" -DescriptionMarkdown ""
|
||||
################################################################################
|
||||
## File: Validate-Sbt.ps1
|
||||
## Desc: Validate sbt for Windows
|
||||
################################################################################
|
||||
|
||||
if((Get-Command -Name 'sbt'))
|
||||
{
|
||||
Write-Host "sbt is on the path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "sbt is not on path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# This works around issue where sbt --script-version does some copies and breaks the build
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName "sbt" -DescriptionMarkdown ""
|
||||
|
||||
@@ -1,67 +1,67 @@
|
||||
################################################################################
|
||||
## File: Validate-Chrome.ps1
|
||||
## Desc: Validate Google Chrome installation.
|
||||
################################################################################
|
||||
|
||||
$IEDriverPath = $env:IEWebDriver
|
||||
$GeckoDriverPath = $env:GeckoWebDriver
|
||||
$ChromeDriverPath = $env:ChromeWebDriver
|
||||
|
||||
if(($IEDriverPath -like "C:\SeleniumWebDrivers\IEDriver") -and ($GeckoDriverPath -like "C:\SeleniumWebDrivers\GeckoDriver") -and ($ChromeDriverPath -like "C:\SeleniumWebDrivers\ChromeDriver"))
|
||||
{
|
||||
|
||||
Write-Host "IEDriver installed at "
|
||||
(Get-Item "C:\SeleniumWebDrivers\IEDriver\IEDriverServer.exe").VersionInfo
|
||||
|
||||
|
||||
Write-Host "Gecko Driver installed at "
|
||||
(Get-Item "C:\SeleniumWebDrivers\GeckoDriver\geckodriver.exe").VersionInfo
|
||||
|
||||
|
||||
Write-Host "Chrome Driver installed at "
|
||||
(Get-Item "C:\SeleniumWebDrivers\ChromeDriver\chromedriver.exe").VersionInfo
|
||||
|
||||
$chromedriverversion = Get-Content -Path "C:\SeleniumWebDrivers\ChromeDriver\versioninfo.txt"
|
||||
$geckodriverversion = Get-Content -Path "C:\SeleniumWebDrivers\GeckoDriver\versioninfo.txt"
|
||||
$iedriverversion = Get-Content -Path "C:\SeleniumWebDrivers\IEDriver\versioninfo.txt"
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Selenium Web Drivers"
|
||||
|
||||
$Description = @"
|
||||
|
||||
#### Chrome Driver
|
||||
|
||||
_version:_
|
||||
$chromedriverversion
|
||||
|
||||
_Environment:_
|
||||
* ChromeWebDriver: location of chromedriver.exe
|
||||
|
||||
#### Gecko Driver
|
||||
|
||||
_version:_
|
||||
$geckodriverversion
|
||||
|
||||
_Environment:_
|
||||
* GeckoWebDriver: location of geckodriver.exe
|
||||
|
||||
#### IE Driver
|
||||
|
||||
_version:_
|
||||
$iedriverversion
|
||||
|
||||
_Environment:_
|
||||
* IEWebDriver: location of IEDriverServer.exe
|
||||
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
exit 0
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Selenium Web Drivers are not installed."
|
||||
exit 1
|
||||
}
|
||||
################################################################################
|
||||
## File: Validate-Chrome.ps1
|
||||
## Desc: Validate Google Chrome installation.
|
||||
################################################################################
|
||||
|
||||
$IEDriverPath = $env:IEWebDriver
|
||||
$GeckoDriverPath = $env:GeckoWebDriver
|
||||
$ChromeDriverPath = $env:ChromeWebDriver
|
||||
|
||||
if(($IEDriverPath -like "C:\SeleniumWebDrivers\IEDriver") -and ($GeckoDriverPath -like "C:\SeleniumWebDrivers\GeckoDriver") -and ($ChromeDriverPath -like "C:\SeleniumWebDrivers\ChromeDriver"))
|
||||
{
|
||||
|
||||
Write-Host "IEDriver installed at "
|
||||
(Get-Item "C:\SeleniumWebDrivers\IEDriver\IEDriverServer.exe").VersionInfo
|
||||
|
||||
|
||||
Write-Host "Gecko Driver installed at "
|
||||
(Get-Item "C:\SeleniumWebDrivers\GeckoDriver\geckodriver.exe").VersionInfo
|
||||
|
||||
|
||||
Write-Host "Chrome Driver installed at "
|
||||
(Get-Item "C:\SeleniumWebDrivers\ChromeDriver\chromedriver.exe").VersionInfo
|
||||
|
||||
$chromedriverversion = Get-Content -Path "C:\SeleniumWebDrivers\ChromeDriver\versioninfo.txt"
|
||||
$geckodriverversion = Get-Content -Path "C:\SeleniumWebDrivers\GeckoDriver\versioninfo.txt"
|
||||
$iedriverversion = Get-Content -Path "C:\SeleniumWebDrivers\IEDriver\versioninfo.txt"
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Selenium Web Drivers"
|
||||
|
||||
$Description = @"
|
||||
|
||||
#### Chrome Driver
|
||||
|
||||
_version:_
|
||||
$chromedriverversion
|
||||
|
||||
_Environment:_
|
||||
* ChromeWebDriver: location of chromedriver.exe
|
||||
|
||||
#### Gecko Driver
|
||||
|
||||
_version:_
|
||||
$geckodriverversion
|
||||
|
||||
_Environment:_
|
||||
* GeckoWebDriver: location of geckodriver.exe
|
||||
|
||||
#### IE Driver
|
||||
|
||||
_version:_
|
||||
$iedriverversion
|
||||
|
||||
_Environment:_
|
||||
* IEWebDriver: location of IEDriverServer.exe
|
||||
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
exit 0
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Selenium Web Drivers are not installed."
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -1,44 +1,44 @@
|
||||
################################################################################
|
||||
## File: Validate-ServiceFabricSDK.ps1
|
||||
## Desc: Validate ServiceFabricSDK
|
||||
################################################################################
|
||||
|
||||
$modules = Get-Module -Name ServiceFabric -ListAvailable
|
||||
|
||||
if(($modules | Measure-Object).Count -gt 0)
|
||||
{
|
||||
$modules
|
||||
}
|
||||
else {
|
||||
Write-Host "ServiceFabric Module is not present, it might not be installed"
|
||||
throw "ServiceFabric Module is not present, it might not be installed"
|
||||
}
|
||||
|
||||
|
||||
function Get-ServiceFabricSDKVersion
|
||||
{
|
||||
$regKey = "HKLM:\Software\Microsoft\Service Fabric SDK"
|
||||
$installedApplications = Get-ItemProperty -Path $regKey
|
||||
$Version = (Get-ItemProperty -Path $regKey).FabricSDKVersion
|
||||
return $Version
|
||||
}
|
||||
|
||||
|
||||
function Get-ServiceFabricVersion
|
||||
{
|
||||
$regKey = "HKLM:\Software\Microsoft\Service Fabric"
|
||||
$installedApplications = Get-ItemProperty -Path $regKey
|
||||
$Version = (Get-ItemProperty -Path $regKey).FabricVersion
|
||||
return $Version
|
||||
}
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Azure Service Fabric"
|
||||
|
||||
$Description = @"
|
||||
_SDK Version:_ $(Get-ServiceFabricSDKVersion)<br/>
|
||||
_Runtime Version:_ $(Get-ServiceFabricVersion)
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-ServiceFabricSDK.ps1
|
||||
## Desc: Validate ServiceFabricSDK
|
||||
################################################################################
|
||||
|
||||
$modules = Get-Module -Name ServiceFabric -ListAvailable
|
||||
|
||||
if(($modules | Measure-Object).Count -gt 0)
|
||||
{
|
||||
$modules
|
||||
}
|
||||
else {
|
||||
Write-Host "ServiceFabric Module is not present, it might not be installed"
|
||||
throw "ServiceFabric Module is not present, it might not be installed"
|
||||
}
|
||||
|
||||
|
||||
function Get-ServiceFabricSDKVersion
|
||||
{
|
||||
$regKey = "HKLM:\Software\Microsoft\Service Fabric SDK"
|
||||
$installedApplications = Get-ItemProperty -Path $regKey
|
||||
$Version = (Get-ItemProperty -Path $regKey).FabricSDKVersion
|
||||
return $Version
|
||||
}
|
||||
|
||||
|
||||
function Get-ServiceFabricVersion
|
||||
{
|
||||
$regKey = "HKLM:\Software\Microsoft\Service Fabric"
|
||||
$installedApplications = Get-ItemProperty -Path $regKey
|
||||
$Version = (Get-ItemProperty -Path $regKey).FabricVersion
|
||||
return $Version
|
||||
}
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Azure Service Fabric"
|
||||
|
||||
$Description = @"
|
||||
_SDK Version:_ $(Get-ServiceFabricSDKVersion)<br/>
|
||||
_Runtime Version:_ $(Get-ServiceFabricVersion)
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
################################################################################
|
||||
## File: Validate-Svn.ps1
|
||||
## Desc: Validate Subversion
|
||||
################################################################################
|
||||
|
||||
if(Get-Command -Name 'svn')
|
||||
{
|
||||
Write-Host "Subversion $(svn --version --quiet) is on the path."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Subversion is not on the path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
$svnVersion = $(svn --version --quiet)
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Subversion"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $svnVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of svn.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-Svn.ps1
|
||||
## Desc: Validate Subversion
|
||||
################################################################################
|
||||
|
||||
if(Get-Command -Name 'svn')
|
||||
{
|
||||
Write-Host "Subversion $(svn --version --quiet) is on the path."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Subversion is not on the path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
$svnVersion = $(svn --version --quiet)
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Subversion"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $svnVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of svn.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,94 +1,94 @@
|
||||
################################################################################
|
||||
## File: Validate-ToolCache.ps1
|
||||
## Desc: Validate Tool Cache
|
||||
################################################################################
|
||||
|
||||
# Helpers
|
||||
function GetChildFolders {
|
||||
param (
|
||||
[Parameter(Mandatory = $True)]
|
||||
[string]$Path
|
||||
)
|
||||
return Get-ChildItem -Path $Path -Directory -Name
|
||||
}
|
||||
|
||||
function ToolcacheTest {
|
||||
param (
|
||||
[Parameter(Mandatory = $True)]
|
||||
[string]$SoftwareName,
|
||||
[Parameter(Mandatory = $True)]
|
||||
[string[]]$ExecTests,
|
||||
[Parameter(Mandatory = $True)]
|
||||
[string]$Note
|
||||
)
|
||||
if (Test-Path "$env:AGENT_TOOLSDIRECTORY\$SoftwareName")
|
||||
{
|
||||
$description = ""
|
||||
[array]$versions = GetChildFolders -Path "$env:AGENT_TOOLSDIRECTORY\$SoftwareName"
|
||||
if ($versions.count -gt 0){
|
||||
foreach ($version in $versions)
|
||||
{
|
||||
$architectures = GetChildFolders -Path "$env:AGENT_TOOLSDIRECTORY\$SoftwareName\$version"
|
||||
|
||||
Write-Host "$SoftwareName version - $version : $([system.String]::Join(",", $architectures))"
|
||||
|
||||
foreach ($arch in $architectures)
|
||||
{
|
||||
$path = "$env:AGENT_TOOLSDIRECTORY\$SoftwareName\$version\$arch"
|
||||
foreach ($test in $ExecTests)
|
||||
{
|
||||
if (Test-Path "$path\$test")
|
||||
{
|
||||
Write-Host "$SoftwareName($test) $version($arch) is successfully installed:"
|
||||
Write-Host (& "$path\$test" --version)
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "$SoftwareName($test) $version ($arch) is not installed"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
$description += "_Version:_ $version ($arch)<br/>"
|
||||
}
|
||||
}
|
||||
|
||||
$description += $Note
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $description
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "$env:AGENT_TOOLSDIRECTORY\$SoftwareName does not include any folders"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "$env:AGENT_TOOLSDIRECTORY\$SoftwareName does not exist"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Python test
|
||||
$PythonNote += @"
|
||||
<br/>
|
||||
> Note: These versions of Python are available through the [Use Python Version](https://go.microsoft.com/fwlink/?linkid=871498) task.
|
||||
"@
|
||||
$PythonTests = @("python.exe", "Scripts\pip.exe")
|
||||
ToolcacheTest -SoftwareName "Python" -ExecTests $PythonTests -Note $PythonNote
|
||||
|
||||
# PyPy test
|
||||
$PyPyNote += @"
|
||||
<br/>
|
||||
> Note: These versions of PyPy are available through the [Use Python Version](https://go.microsoft.com/fwlink/?linkid=871498) task.
|
||||
"@
|
||||
$PyPyTests = @("python.exe", "bin\pip.exe")
|
||||
ToolcacheTest -SoftwareName "PyPy" -ExecTests $PyPyTests -Note $PyPyNote
|
||||
|
||||
# Ruby test
|
||||
$RubyNote += @"
|
||||
<br/>
|
||||
> Note: These versions of Ruby are available through the [Use Ruby Version](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/use-ruby-version) task.
|
||||
"@
|
||||
$RubyTests = @("bin\ruby.exe")
|
||||
ToolcacheTest -SoftwareName "Ruby" -ExecTests $RubyTests -Note $RubyNote
|
||||
################################################################################
|
||||
## File: Validate-ToolCache.ps1
|
||||
## Desc: Validate Tool Cache
|
||||
################################################################################
|
||||
|
||||
# Helpers
|
||||
function GetChildFolders {
|
||||
param (
|
||||
[Parameter(Mandatory = $True)]
|
||||
[string]$Path
|
||||
)
|
||||
return Get-ChildItem -Path $Path -Directory -Name
|
||||
}
|
||||
|
||||
function ToolcacheTest {
|
||||
param (
|
||||
[Parameter(Mandatory = $True)]
|
||||
[string]$SoftwareName,
|
||||
[Parameter(Mandatory = $True)]
|
||||
[string[]]$ExecTests,
|
||||
[Parameter(Mandatory = $True)]
|
||||
[string]$Note
|
||||
)
|
||||
if (Test-Path "$env:AGENT_TOOLSDIRECTORY\$SoftwareName")
|
||||
{
|
||||
$description = ""
|
||||
[array]$versions = GetChildFolders -Path "$env:AGENT_TOOLSDIRECTORY\$SoftwareName"
|
||||
if ($versions.count -gt 0){
|
||||
foreach ($version in $versions)
|
||||
{
|
||||
$architectures = GetChildFolders -Path "$env:AGENT_TOOLSDIRECTORY\$SoftwareName\$version"
|
||||
|
||||
Write-Host "$SoftwareName version - $version : $([system.String]::Join(",", $architectures))"
|
||||
|
||||
foreach ($arch in $architectures)
|
||||
{
|
||||
$path = "$env:AGENT_TOOLSDIRECTORY\$SoftwareName\$version\$arch"
|
||||
foreach ($test in $ExecTests)
|
||||
{
|
||||
if (Test-Path "$path\$test")
|
||||
{
|
||||
Write-Host "$SoftwareName($test) $version($arch) is successfully installed:"
|
||||
Write-Host (& "$path\$test" --version)
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "$SoftwareName($test) $version ($arch) is not installed"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
$description += "_Version:_ $version ($arch)<br/>"
|
||||
}
|
||||
}
|
||||
|
||||
$description += $Note
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $description
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "$env:AGENT_TOOLSDIRECTORY\$SoftwareName does not include any folders"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "$env:AGENT_TOOLSDIRECTORY\$SoftwareName does not exist"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Python test
|
||||
$PythonNote += @"
|
||||
<br/>
|
||||
> Note: These versions of Python are available through the [Use Python Version](https://go.microsoft.com/fwlink/?linkid=871498) task.
|
||||
"@
|
||||
$PythonTests = @("python.exe", "Scripts\pip.exe")
|
||||
ToolcacheTest -SoftwareName "Python" -ExecTests $PythonTests -Note $PythonNote
|
||||
|
||||
# PyPy test
|
||||
$PyPyNote += @"
|
||||
<br/>
|
||||
> Note: These versions of PyPy are available through the [Use Python Version](https://go.microsoft.com/fwlink/?linkid=871498) task.
|
||||
"@
|
||||
$PyPyTests = @("python.exe", "bin\pip.exe")
|
||||
ToolcacheTest -SoftwareName "PyPy" -ExecTests $PyPyTests -Note $PyPyNote
|
||||
|
||||
# Ruby test
|
||||
$RubyNote += @"
|
||||
<br/>
|
||||
> Note: These versions of Ruby are available through the [Use Ruby Version](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/use-ruby-version) task.
|
||||
"@
|
||||
$RubyTests = @("bin\ruby.exe")
|
||||
ToolcacheTest -SoftwareName "Ruby" -ExecTests $RubyTests -Note $RubyNote
|
||||
|
||||
@@ -1,27 +1,26 @@
|
||||
################################################################################
|
||||
## File: Validate-TypeScript.ps1
|
||||
## Team: CI Build
|
||||
## Desc: Validate Typescript Installation
|
||||
################################################################################
|
||||
|
||||
if(Get-Command -Name 'tsc')
|
||||
{
|
||||
Write-Host "TypeScript $(tsc --version) is on the path."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "TypeScript is not on the path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
$typescriptVersion = $(tsc --version)
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "TypeScript"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $typescriptVersion<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-TypeScript.ps1
|
||||
## Desc: Validate Typescript Installation
|
||||
################################################################################
|
||||
|
||||
if(Get-Command -Name 'tsc')
|
||||
{
|
||||
Write-Host "TypeScript $(tsc --version) is on the path."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "TypeScript is not on the path."
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
$typescriptVersion = $(tsc --version)
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "TypeScript"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $typescriptVersion<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
################################################################################
|
||||
## File: Validate-Vcpkg.ps1
|
||||
## Desc: Validate vcpkg Cli
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'Vcpkg')
|
||||
{
|
||||
Write-Host 'Vcpkg is succesfully installed:'
|
||||
vcpkg version | Write-Host
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'Vcpkg is not on PATH'
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ($env:VCPKG_INSTALLATION_ROOT)
|
||||
{
|
||||
Write-Host "The VCPKG_INSTALLATION_ROOT environment variable is set"
|
||||
Write-Host $env:VCPKG_INSTALLATION_ROOT
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "The VCPKG_INSTALLATION_ROOT environment variable is not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
|
||||
# `vcpkg version` gives output like:
|
||||
# Vcpkg package management program version 2018.11.23-nohash
|
||||
#
|
||||
# See LICENSE.txt for license information.
|
||||
|
||||
$SoftwareName = 'Vcpkg'
|
||||
$(vcpkg version).Split([System.Environment]::NewLine)[0] -match "\d+.\d+.\d+.*"
|
||||
$VcpkgVersion = $Matches[0]
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $VcpkgVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of the vcpkg directory
|
||||
* VCPKG_INSTALLATION_ROOT: root directory of the vcpkg installation
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-Vcpkg.ps1
|
||||
## Desc: Validate vcpkg Cli
|
||||
################################################################################
|
||||
|
||||
if (Get-Command -Name 'Vcpkg')
|
||||
{
|
||||
Write-Host 'Vcpkg is succesfully installed:'
|
||||
vcpkg version | Write-Host
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host 'Vcpkg is not on PATH'
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ($env:VCPKG_INSTALLATION_ROOT)
|
||||
{
|
||||
Write-Host "The VCPKG_INSTALLATION_ROOT environment variable is set"
|
||||
Write-Host $env:VCPKG_INSTALLATION_ROOT
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "The VCPKG_INSTALLATION_ROOT environment variable is not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
|
||||
# `vcpkg version` gives output like:
|
||||
# Vcpkg package management program version 2018.11.23-nohash
|
||||
#
|
||||
# See LICENSE.txt for license information.
|
||||
|
||||
$SoftwareName = 'Vcpkg'
|
||||
$(vcpkg version).Split([System.Environment]::NewLine)[0] -match "\d+.\d+.\d+.*"
|
||||
$VcpkgVersion = $Matches[0]
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $VcpkgVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of the vcpkg directory
|
||||
* VCPKG_INSTALLATION_ROOT: root directory of the vcpkg installation
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
################################################################################
|
||||
## File: Validate-WinAppDriver.ps1
|
||||
## Desc: Validate WinAppDriver installation
|
||||
################################################################################
|
||||
|
||||
$wad = "Windows Application Driver";
|
||||
if (${Env:ProgramFiles(x86)})
|
||||
{
|
||||
$wadPath = "${Env:ProgramFiles(x86)}\$wad"
|
||||
}
|
||||
else
|
||||
{
|
||||
$wadPath = "${Env:ProgramFiles}\$wad"
|
||||
}
|
||||
|
||||
if(Test-Path $wadPath -PathType Any)
|
||||
{
|
||||
Write-Host "WinAppDriver directory found."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Failed to locate WinAppDriver directory. Exiting."
|
||||
exit 1
|
||||
}
|
||||
|
||||
#Validate if Developer Mode is enabled
|
||||
$path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock";
|
||||
if((Get-ItemProperty -Path $path | Select-Object -ExpandProperty "AllowDevelopmentWithoutDevLicense") -eq 1)
|
||||
{
|
||||
Write-Host "Developer Mode is successfully provisioned."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Developer Mode was not successfully provisioned."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "WinAppDriver"
|
||||
$version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe").FileVersion
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-WinAppDriver.ps1
|
||||
## Desc: Validate WinAppDriver installation
|
||||
################################################################################
|
||||
|
||||
$wad = "Windows Application Driver";
|
||||
if (${Env:ProgramFiles(x86)})
|
||||
{
|
||||
$wadPath = "${Env:ProgramFiles(x86)}\$wad"
|
||||
}
|
||||
else
|
||||
{
|
||||
$wadPath = "${Env:ProgramFiles}\$wad"
|
||||
}
|
||||
|
||||
if(Test-Path $wadPath -PathType Any)
|
||||
{
|
||||
Write-Host "WinAppDriver directory found."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Failed to locate WinAppDriver directory. Exiting."
|
||||
exit 1
|
||||
}
|
||||
|
||||
#Validate if Developer Mode is enabled
|
||||
$path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock";
|
||||
if((Get-ItemProperty -Path $path | Select-Object -ExpandProperty "AllowDevelopmentWithoutDevLicense") -eq 1)
|
||||
{
|
||||
Write-Host "Developer Mode is successfully provisioned."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Developer Mode was not successfully provisioned."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "WinAppDriver"
|
||||
$version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe").FileVersion
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user