PlannerOne.Deployment.psm1

$global:P1SrvExe = "PlannerOneService.exe"
$global:IISRootPath = "C:\inetpub\wwwroot"
$global:DISMModulePath = "${env:ProgramFiles(x86)}\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\amd64\DISM"
$global:SourceURL = "https://www.myget.org/F/plannerone/auth/{0}/api/v2"
$global:P1SrvPackage = "PlannerOne.[Adapter].Server"
$global:P1WebPackage = "PlannerOne.[Adapter].WebApp"
$global:P1NavToolPackage = "PlannerOne.NAV.[Version]"
$global:TenantPrefix = "PlannerOne"
$global:DefaultWebPort = [int] 9010
$global:VerboseLevel = 0
$global:SupportedNavVersions  = ("2013R2", "2015", "2016", "2017", "2018")
$global:SupportedNAVVersionCodes = @{71="2013R2"; 80="2015"; 90="2016"; 100="2017"; 110="2018"}
$global:SupportedNAVBinairesYear = @{7.1="2013R2"; 8.0="2015"; 9.0="2016"; 10.0="2017"; 11.0="2018"}
$global:SupportedNAVBinairiesFolder = @{"7.1"="71"; "8.0"="80"; "9.0"="90"; "10.0"="100"; "11.0"="110"}
$global:ERPS = ("AP", "NAV", "SAGE", "NoAdapter")
$global:ERPToAdapter = @{ "AP" = "AP"; "NAV" = "NAV"; "SAGE" = "REST"; "NoAdapter" = "NoAdapter" }
$global:AdapterToERP = @{ "AP" = "AP"; "NAV" = "NAV"; "REST" = "SAGE"; "NoAdapter" = "NoAdapter"}
$global:SamplesURL = "http://www.plannerone.com/doc/V6.0/[ERP]/samples"
$global:ContextStorePathDir = "$env:ProgramData\PlannerOne\"
$global:ContextStorePath = "$ContextStorePathDir\CurrentContext.json"
# Write-Output "Getting functions from $PSScriptRoot"
#Get public and private function definition files.
$Public  = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue )
$Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue )
$Dev = @( Get-ChildItem -Path $PSScriptRoot\Dev\*.ps1 -ErrorAction SilentlyContinue )

#Dot source the files
Foreach($import in @($Public + $Private + $Dev))
{
    Try
    {
        # Write-Output "Import"$import.fullname
        
        . $import.fullname
    }
    Catch
    {
        Write-Error -Message "Failed to import function $($import.fullname): $_"
    }
}

# Here I might...
    # Read in or create an initial config file and variable
    # Export Public functions ($Public.BaseName) for WIP modules
    # Set variables visible to the module and its functions only

Export-ModuleMember -Function $Public.Basename
Export-ModuleMember -Function $Dev.Basename