Initialize-ModuleDirectories.ps1

# Define Module Default Directories
$global:ModuleRootDir = "C:\Integris\PowerShell Module"
$global:ModuleUtilityDir = "C:\Program Files\IntegrisPowerShell Utilities"
$global:ModuleLogDir = Join-Path -Path $ModuleRootDir -ChildPath "Logs"
$global:ModuleExportDir = Join-Path -Path $ModuleRootDir -ChildPath "Exports"

# Create Root directory, if it does not exist
IF (!(Test-Path -Path $ModuleRootDir -PathType Container)) {
    Write-Debug "Creating Folder: $ModuleRootDir"
    New-Item -ItemType Directory -Force -Path $ModuleRootDir | Out-Null
}

# Create Utility directory, if it does not exist
IF (!(Test-Path -Path $ModuleUtilityDir -PathType Container)) {
    Write-Debug "Creating Folder: $ModuleUtilityDir"
    New-Item -ItemType Directory -Force -Path $ModuleUtilityDir | Out-Null
}

# Create Log directory, if it does not exist
IF (!(Test-Path -Path $ModuleLogDir -PathType Container)) {
    Write-Debug "Creating Folder: $ModuleLogDir"
    New-Item -ItemType Directory -Force -Path $ModuleLogDir | Out-Null
}

# Create Export directory, if it does not exist
IF (!(Test-Path -Path $ModuleExportDir -PathType Container)) {
    Write-Debug "Creating Folder: $ModuleExportDir"
    New-Item -ItemType Directory -Force -Path $ModuleExportDir | Out-Null
}