PlannerOne.Deployment.psm1

$global:P1SrvExe = "PlannerOneService.exe"
$global:IISRootPath = "C:\inetpub\wwwroot"
$global:DISMModulePath = "C:\Program Files (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:NavVersion  = ("2013R2", "2015", "2016", "2017")
$global:ERPToAdapter = @{ "AP" = "AP"; "NAV" = "NAV"; "SAGE" = "REST" }
$global:AdapterToERP = @{ "AP" = "AP"; "NAV" = "NAV"; "REST" = "SAGE" }
$global:NAVAdapterParameters = @{
    "Server" = "Server";
    "SOAPPort" = "Port";
    "AuthenticationMode" = "AuthenticationMode";
    "SSL" = "SSL";
    "RTCPort" = "ClientPort";
    "Instance" = "InstanceName";
    "ServiceAccountDomain" = "ServiceDomain";
    "ServiceAccountLogin" = "ServiceLogin";
    "ServiceAccountPassword" = "UnencryptedServicePassword";
    "SendBatchSize" = "SenderBatchSize";
    "SynchronizationTick" = "SynchronizationTimerStep";
    "MapOperationOnIgnoreResources" = "MapOperationOnIgnoreResources";
    "MapReservations" = "MapReservations";
    "KeepAlive" = "KeepAlive";
    "Tenant" = "TenantName";
    "WebServer" = "WebServerName";
    "WebPort" = "WebSitePort";
}

$global:NAVAdapterParametersType = @{
    "Server" = "string";
    "SOAPPort" = "int";
    "AuthenticationMode" = "string";
    "SSL" = "bool";
    "RTCPort" = "int";
    "Instance" = "string";
    "ServiceAccountDomain" = "string";
    "ServiceAccountLogin" = "string";
    "ServiceAccountPassword" = "string";
    "SendBatchSize" = "int";
    "SynchronizationTick" = "int";
    "MapOperationOnIgnoreResources" = "bool";
    "MapReservations" = "bool";
    "KeepAlive" = "bool";
    "Tenant" = "string";
    "WebServer" = "string";
    "WebPort" = "string";
}

# 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 )

#Dot source the files
Foreach($import in @($Public + $Private))
{
    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