000_bootstrap.ps1 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #**************************************************************************#
  2. #** QUADARAX DEPLOYMENT SCRIPTS **#
  3. #** File: 000_bootstrap.ps1 **#
  4. #** Description: Defines startup properies, libraries, constants **#
  5. #** to work with QDS **#
  6. #** Version: 1.0. **#
  7. #** Updated: 26.7.2019 **#
  8. #**************************************************************************#
  9. # Console settings
  10. Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted
  11. Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
  12. if ($global:NonInteractive -ne $true)
  13. {
  14. $a = (Get-Host).UI.RawUI
  15. $a.WindowTitle = "QUADARAX DEPLOYMENT CONSOLE"
  16. }
  17. # Startup location
  18. $scriptpath = $MyInvocation.MyCommand.Path
  19. $currentDir = Split-Path $scriptpath
  20. Write-Host ("* QUADARAX DEPLOYMENT CONSOLE *") -ForegroundColor Green
  21. Write-Host " _____ ____ ___ " -ForegroundColor Green
  22. Write-Host " ( _ )( _ \ / __) " -ForegroundColor Green
  23. Write-Host " )(_)( )(_) )\__ \ " -ForegroundColor Green
  24. Write-Host " (___/\\(____/ (___/ " -ForegroundColor Green
  25. # Check permissions
  26. Write-Host "Checking permission..." -foregroundcolor DarkGray
  27. If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
  28. {
  29. Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!`n`n"
  30. Write-Host "Loading failed..." -foregroundcolor Red
  31. Break
  32. }
  33. # Set variable that bootstrap script loaded
  34. $global:SpaceScriptLoaded = $true
  35. # Loads prerequisities
  36. . .\001_settings.ps1
  37. . .\002_library.ps1
  38. Write-Host "QDS bootstrap was set-up." -ForegroundColor DarkGray
  39. Write-Host ("Project directory: {0}" -f $projectDir) -ForegroundColor Green