Scripts/bootstrap.ps1

$WarningPreference = 'SilentlyContinue'
$ProgressPreference = 'SilentlyContinue'
$ErrorActionPreference = 'Stop'

$rootPath = Split-Path $PSScriptRoot -Parent

$requiredModules = Import-PowerShellDataFile $rootPath/requirements.psd1

# Load the required modules, this will expose a variable called $requiredModules


Write-Host "Loading required modules... Please wait."

foreach ($moduleDepName in $requiredModules.Keys) {


    $mydep = $requiredModules.$moduleDepName

    if ($mydep.Tags -eq $null){
        continue
    }

    if ($mydep.Tags.Contains("run")){
        write-host "Importing $($mydep.Name) with required version $($mydep.Version)"
        Import-Module -Name $mydep.Name -RequiredVersion $mydep.Version  -Force| Out-Null
    }
}

Write-Host "Required modules loaded."