PSAutoLab.psm1

[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")]
param()

#dot source functions
Get-ChildItem -path $PSScriptRoot\Functions\*.ps1 | ForEach-Object { . $_.FullName }

#this variable is used for Refresh-Host to copy configurations from the module to Autolab\Configurations
$ConfigurationPath = Join-Path -Path $PSScriptRoot -ChildPath Configurations

#declare the currently supported version of Pester
#Pester v5 is supported with v5.0.0 of this module

$PesterVersion = "5.4.0"

#declare the currently supported version of Lability
$LabilityVersion = "0.25.0"

#configure TLS protocol to avoid problems downloading files from Microsoft
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

#open the PDF help file
Function Open-PSAutoLabHelp {
    [cmdletbinding()]
    Param()

    $pdf = Join-Path -Path $PSScriptRoot -ChildPath PSAutoLabManual.pdf
    if (Test-Path -Path $pdf) {
        Try {
            Start-Process -FilePath $pdf -ErrorAction Stop
        }
        Catch {
            Write-Warning "Failed to automatically open the PDF. You will need to manually open $pdf."
        }
    }
    else {
        Write-Warning "Can't find $pdf."
    }
}