Skip to content
20 changes: 10 additions & 10 deletions build/windows/Makefile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ Write-Host("current script dir : " + $currentdir + " ")

if ($false -eq (Test-Path -Path $currentdir)) {
Write-Host("Invalid current dir : " + $currentdir + " ") -ForegroundColor Red
exit
exit 1
}

$builddir = Split-Path -Path $currentdir
Write-Host("builddir dir : " + $builddir + " ")
if ($false -eq (Test-Path -Path $builddir)) {
Write-Host("Invalid build dir : " + $builddir + " ") -ForegroundColor Red
exit
exit 1
}

$versionFilePath = Join-Path -Path $builddir -child "version"
Write-Host("versionFilePath : " + $versionFilePath + " ")
if ($false -eq (Test-Path -Path $versionFilePath)) {
Write-Host("Version file path incorrect or doesnt exist : " + $versionFilePath + " ") -ForegroundColor Red
exit
exit 1
}

# read the version info
Expand All @@ -36,7 +36,7 @@ foreach($line in Get-Content -Path $versionFilePath) {
$parts = $line.split("=")
if ($parts.length -lt 2 ) {
Write-Host("Invalid content in version file : " + $versionFilePath + " ") -ForegroundColor Red
exit
exit 1
}
switch ($parts[0]) {
"CONTAINER_BUILDVERSION_MAJOR" { $BuildVersionMajor = $parts[1] }
Expand All @@ -57,7 +57,7 @@ if ([string]::IsNullOrEmpty($BuildVersionMajor) -or
[string]::IsNullOrEmpty($BuildVersionDate) -or
[string]::IsNullOrEmpty($BuildVersionStatus)) {
Write-Host("Expected version info doesnt exist in this version file : " + $versionFilePath + " ") -ForegroundColor Red
exit
exit 1
}
# build version format will be [major].[minior].[patch]-[revision]
$buildVersionString = $BuildVersionMajor + "." + $BuildVersionMinor + "." + $BuildVersionPatch + "-" + $BuildVersionBuildNR
Expand All @@ -68,7 +68,7 @@ $certsrcdir = Join-Path -Path $builddir -ChildPath "windows\installer\certificat
Write-Host("certsrc dir : " + $certsrcdir + " ")
if ($false -eq (Test-Path -Path $certsrcdir)) {
Write-Host("Invalid certificate generator source dir : " + $certsrcdir + " ") -ForegroundColor Red
exit
exit 1
}
Write-Host("set the cerificate generator source code directory : " + $certsrcdir + " ...")
Set-Location -Path $certsrcdir
Expand Down Expand Up @@ -100,13 +100,13 @@ Write-Host("Successfully published certificate generator code binaries") -Foregr
$certreleasebinpath = Join-Path -PATH $certsrcdir -ChildPath "bin\Release\$dotnetcoreframework\win10-x64\publish\*.*"
if ($false -eq (Test-Path -Path $certreleasebinpath)) {
Write-Host("certificate release bin path doesnt exist : " + $certreleasebinpath + " ") -ForegroundColor Red
exit
exit 1
}

$rootdir = Split-Path -Path $builddir
if ($false -eq (Test-Path -Path $rootdir)) {
Write-Host("Invalid docker provider root source dir : " + $rootdir + " ") -ForegroundColor Red
exit
exit 1
}

$publishdir = Join-Path -Path $rootdir -ChildPath "kubernetes\windows\omsagentwindows"
Expand All @@ -128,7 +128,7 @@ $outomsgoplugindir = Join-Path -Path $rootdir -ChildPath "source\plugins\go\src"
Write-Host("Building Out_OMS go plugin code...")
if ($false -eq (Test-Path -Path $outomsgoplugindir)) {
Write-Host("Invalid Out oms go plugin code dir : " + $outomsgoplugindir + " ") -ForegroundColor Red
exit
exit 1
}
Set-Location -Path $outomsgoplugindir

Expand Down Expand Up @@ -178,7 +178,7 @@ if (Test-Path -Path $livenessprobeexepath){
Write-Host("livenessprobe.exe exists which indicates cpp build step succeeded") -ForegroundColor Green
} else {
Write-Host("livenessprobe.exe doesnt exist which indicates cpp build step failed") -ForegroundColor Red
exit
exit 1
}

$installerdir = Join-Path -Path $builddir -ChildPath "common\installer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ Write-Host("current script dir : " + $currentdir + " ")

if ($false -eq (Test-Path -Path $currentdir)) {
Write-Host("Invalid current dir : " + $currentdir + " ") -ForegroundColor Red
exit
exit 1
}

if ([string]::IsNullOrEmpty($image)) {
Write-Host "Image parameter shouldnt be null or empty" -ForegroundColor Red
exit
exit 1
}

$imageparts = $image.split(":")
if (($imageparts.Length -ne 2)){
Write-Host "Image not in valid format. Expected format should be <repo>/<image>:<imagetag>" -ForegroundColor Red
exit
exit 1
}

$imagetag = $imageparts[1].ToLower()
Expand All @@ -48,7 +48,7 @@ $dockerFileDir = Split-Path -Path $currentdir
Write-Host("builddir dir : " + $dockerFileDir + " ")
if ($false -eq (Test-Path -Path $dockerFileDir)) {
Write-Host("Invalid dockerFile Dir : " + $dockerFileDir + " ") -ForegroundColor Red
exit
exit 1
}

Write-Host "changing directory to DockerFile dir: $dockerFileDir"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ Write-Host("current script dir : " + $currentdir + " ")

if ($false -eq (Test-Path -Path $currentdir)) {
Write-Host("Invalid current dir : " + $currentdir + " ") -ForegroundColor Red
exit
exit 1
}

if ([string]::IsNullOrEmpty($image)) {
Write-Host "Image parameter shouldnt be null or empty" -ForegroundColor Red
exit
exit 1
}

$imageparts = $image.split(":")
if (($imageparts.Length -ne 2)){
Write-Host "Image not in valid format. Expected format should be <repo>/<image>:<imagetag>" -ForegroundColor Red
exit
exit 1
}

$imagetag = $imageparts[1].ToLower()
Expand All @@ -48,7 +48,7 @@ $dockerFileDir = Split-Path -Path $currentdir
Write-Host("builddir dir : " + $dockerFileDir + " ")
if ($false -eq (Test-Path -Path $dockerFileDir)) {
Write-Host("Invalid dockerFile Dir : " + $dockerFileDir + " ") -ForegroundColor Red
exit
exit 1
}

Write-Host "changing directory to DockerFile dir: $dockerFileDir"
Expand Down
6 changes: 3 additions & 3 deletions kubernetes/windows/dockerbuild/build-dev-base-image.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<#
.DESCRIPTION
Builds the Docker Image locally for the server core ltsc base and installs dependencies
Builds the Docker Image locally for the server core ltsc base and installs dependencies

#>

Expand All @@ -9,7 +9,7 @@ Write-Host("current script dir : " + $currentdir + " ")

if ($false -eq (Test-Path -Path $currentdir)) {
Write-Host("Invalid current dir : " + $currentdir + " ") -ForegroundColor Red
exit
exit 1
}

Write-Host "start:Building the cert generator and out oms code via Makefile.ps1"
Expand All @@ -20,7 +20,7 @@ $dockerFileDir = Split-Path -Path $currentdir
Write-Host("builddir dir : " + $dockerFileDir + " ")
if ($false -eq (Test-Path -Path $dockerFileDir)) {
Write-Host("Invalid dockerFile Dir : " + $dockerFileDir + " ") -ForegroundColor Red
exit
exit 1
}

Write-Host "changing directory to DockerFile dir: $dockerFileDir"
Expand Down
16 changes: 8 additions & 8 deletions scripts/build/windows/install-build-pre-requisites.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ function Install-Go {
$tempDir = $env:TEMP
if ($false -eq (Test-Path -Path $tempDir)) {
Write-Host("Invalid TEMP dir PATH : " + $tempDir + " ") -ForegroundColor Red
exit
exit 1
}

$tempGo = Join-Path -Path $tempDir -ChildPath "gotemp"
Write-Host("creating gotemp dir : " + $tempGo + " ")
New-Item -Path $tempGo -ItemType "directory" -Force -ErrorAction Stop
if ($false -eq (Test-Path -Path $tempGo)) {
Write-Host("Invalid tempGo : " + $tempGo + " ") -ForegroundColor Red
exit
exit 1
}

$url = "https://dl.google.com/go/go1.15.14.windows-amd64.msi"
Expand All @@ -35,15 +35,15 @@ function Build-Dependencies {
$tempDir = $env:TEMP
if ($false -eq (Test-Path -Path $tempDir)) {
Write-Host("Invalid TEMP dir PATH : " + $tempDir + " ") -ForegroundColor Red
exit
exit 1
}

$tempDependencies = Join-Path -Path $tempDir -ChildPath "gcctemp"
Write-Host("creating temp dir exist: " + $tempDependencies + " ")
New-Item -Path $tempDependencies -ItemType "directory" -Force -ErrorAction Stop
if ($false -eq (Test-Path -Path $tempDependencies)) {
Write-Host("Invalid temp Dir : " + $tempDependencies + " ") -ForegroundColor Red
exit
exit 1
}


Expand Down Expand Up @@ -82,15 +82,15 @@ function Install-DotNetCoreSDK() {
$tempDir = $env:TEMP
if ($false -eq (Test-Path -Path $tempDir)) {
Write-Host("Invalid TEMP dir : " + $tempDir + " ") -ForegroundColor Red
exit
exit 1
}

$dotNetSdkTemp = Join-Path -Path $tempDir -ChildPath "dotNetSdk"
Write-Host("creating dotNetSdkTemp dir : " + $dotNetSdkTemp + " ")
New-Item -Path $dotNetSdkTemp -ItemType "directory" -Force -ErrorAction Stop
if ($false -eq (Test-Path -Path $dotNetSdkTemp)) {
Write-Host("Invalid dotNetSdkTemp : " + $tempDir + " ") -ForegroundColor Red
exit
exit 1
}

$url = "https://download.visualstudio.microsoft.com/download/pr/4e88f517-196e-4b17-a40c-2692c689661d/eed3f5fca28262f764d8b650585a7278/dotnet-sdk-3.1.301-win-x64.exe"
Expand All @@ -110,15 +110,15 @@ function Install-Docker() {
$tempDir = $env:TEMP
if ($false -eq (Test-Path -Path $tempDir)) {
Write-Host("Invalid TEMP dir PATH : " + $tempDir + " ") -ForegroundColor Red
exit
exit 1
}

$dockerTemp = Join-Path -Path $tempDir -ChildPath "docker"
Write-Host("creating docker temp dir : " + $dockerTemp + " ")
New-Item -Path $dockerTemp -ItemType "directory" -Force -ErrorAction Stop
if ($false -eq (Test-Path -Path $dockerTemp)) {
Write-Host("Invalid dockerTemp : " + $tempDir + " ") -ForegroundColor Red
exit
exit 1
}

$url = "https://download.docker.com/win/stable/Docker%20Desktop%20Installer.exe"
Expand Down
22 changes: 11 additions & 11 deletions scripts/onboarding/aks/mdmonboarding/mdm_onboarding.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if (($null -eq $azAccountModule) -or ($null -eq $azAksModule) -or ($null -eq $az
else {
Write-Host("Please run the script as an administrator") -ForegroundColor Red
Stop-Transcript
exit
exit 1
}


Expand All @@ -66,7 +66,7 @@ if (($null -eq $azAccountModule) -or ($null -eq $azAksModule) -or ($null -eq $az
}
catch {
Write-Host("Close other powershell logins and try installing the latest modules forAz.Accounts in a new powershell window: eg. 'Install-Module Az.Accounts -Repository PSGallery -Force'") -ForegroundColor Red
exit
exit 1
}
}

Expand All @@ -77,7 +77,7 @@ if (($null -eq $azAccountModule) -or ($null -eq $azAksModule) -or ($null -eq $az
}
catch {
Write-Host("Close other powershell logins and try installing the latest modules forAz.Accounts in a new powershell window: eg. 'Install-Module Az.Accounts -Repository PSGallery -Force'") -ForegroundColor Red
exit
exit 1
}
}

Expand All @@ -88,7 +88,7 @@ if (($null -eq $azAccountModule) -or ($null -eq $azAksModule) -or ($null -eq $az
}
catch {
Write-Host("Close other powershell logins and try installing the latest modules for Az.Aks in a new powershell window: eg. 'Install-Module Az.Aks -Repository PSGallery -Force'") -ForegroundColor Red
exit
exit 1
}
}

Expand All @@ -103,7 +103,7 @@ if (($null -eq $azAccountModule) -or ($null -eq $azAksModule) -or ($null -eq $az
Write-Host("Could not import Az.Resources...") -ForegroundColor Red
Write-Host("Close other powershell logins and try installing the latest modules for Az.Resources in a new powershell window: eg. 'Install-Module Az.Resources -Repository PSGallery -Force'") -ForegroundColor Red
Stop-Transcript
exit
exit 1
}
}
if ($null -eq $azAccountModule) {
Expand All @@ -114,7 +114,7 @@ if (($null -eq $azAccountModule) -or ($null -eq $azAksModule) -or ($null -eq $az
Write-Host("Could not import Az.Accounts...") -ForegroundColor Red
Write-Host("Close other powershell logins and try installing the latest modules for Az.Accounts in a new powershell window: eg. 'Install-Module Az.Accounts -Repository PSGallery -Force'") -ForegroundColor Red
Stop-Transcript
exit
exit 1
}
}
if ($null -eq $azAksModule) {
Expand All @@ -124,15 +124,15 @@ if (($null -eq $azAccountModule) -or ($null -eq $azAksModule) -or ($null -eq $az
catch {
Write-Host("Could not import Az.Aks... Please reinstall this Module") -ForegroundColor Red
Stop-Transcript
exit
exit 1
}
}

}
2 {
Write-Host("")
Stop-Transcript
exit
exit 1
}
}
}
Expand Down Expand Up @@ -161,7 +161,7 @@ if ($account.Account -eq $null) {
Write-Host("Could not select subscription with ID : " + $SubscriptionId + ". Please make sure the ID you entered is correct and you have access to the cluster" ) -ForegroundColor Red
Write-Host("")
Stop-Transcript
exit
exit 1
}
}
else {
Expand All @@ -181,7 +181,7 @@ else {
Write-Host("Could not select subscription with ID : " + $SubscriptionId + ". Please make sure the ID you entered is correct and you have access to the cluster" ) -ForegroundColor Red
Write-Host("")
Stop-Transcript
exit
exit 1
}
}
}
Expand All @@ -196,7 +196,7 @@ if ($notPresent) {
Write-Host("Could not find Aks cluster. Please make sure that specified cluster exists: '" + $clusterName + "'is correct and you have access to the cluster") -ForegroundColor Red
Write-Host("")
Stop-Transcript
exit
exit 1
}
Write-Host("Successfully checked specified cluster exists details...") -ForegroundColor Green

Expand Down
Loading