Ndimensions.Automation.NafSetup.psm1

<#
    .SYNOPSIS
    Ndimensions Automation Framework Setup
 
    .DESCRIPTION
    Ndimensions Automation Framework Setup
    - Prepare machine for downloading git repositories. Installs git related client software
    - Downloads the NAF repositories
 
    .NOTES
    Author : hillesheim@n-dimensions.de
    Version : 2.8
    DateLastChanged : 2024-01-06
#>
 

Write-Host "Load module 'Ndimensions.Automation.NafSetup' ... "

#region DECLARATION

#region USER_VARIABLES

# ********************************************************************************************
# Artifact settings

[ArtifactSettings] $artifactSettings = [ArtifactSettings]::new(); 
$artifactSettings.DevopsUrl = "https://pkgs.dev.azure.com"; 
$artifactSettings.OrganizationName = "n-dimensions-dev"; 
$artifactSettings.ProjectName = "NAF"; 
$artifactSettings.CredProviderInstallUrl = "https://aka.ms/install-artifacts-credprovider.ps1"; 

# ********************************************************************************
# Nuget default settings

[NugetSettings] $nugetSettings = [NugetSettings]::new();     
$nugetSettings.NugetExeDownloadUrl = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"; 
$nugetSettings.NuGetSourceName = "Ndimensions AzArtifacts"; 
$nugetSettings.NugetProgramFolder = "C:\Program Files\Nuget"; 
$nugetSettings.NugetPackagesInstallFolder = "C:\Program Files\Nuget\Packages"; 

# ********************************************************************************************
# ********************************************************************************************
# Nuget packages
[NugetPackage[]] $nugetPackages = @(); 

# ********************************************************************************************
# ... Package "Ndimensions Automation Modules"

[NugetPackage] $packageNafAutomation = [NugetPackage]::new(); 
$packageNafAutomation.Name = "Ndimensions Automation Modules"; 
$packageNafAutomation.BaseName = "Ndimensions.Automation.Modules"; 
$packageNafAutomation.Description = "Ndimensions Automation Modules: Contains common PowerShell modules for the 'Ndimensions Automation Framework' (NAF)"; 
# $packageNafAutomation.DownloadFolder = "C:\_NAF\Modules\Test\nupkg";
$packageNafAutomation.DownloadFolder = "C:\_NAF\Modules"; 
$packageNafAutomation.ArtifactFeedId = "NdimensionsAutomationModules"; 
$packageNafAutomation.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageNafAutomation `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageNafAutomation; 

# ********************************************************************************************
# ... Package "Ndimensions Deployment Modules"

[NugetPackage] $packageNafDeployment = [NugetPackage]::new(); 
$packageNafDeployment.Name = "Ndimensions Deployment Modules"; 
$packageNafDeployment.BaseName = "Ndimensions.Deployment.Modules"; 
$packageNafDeployment.Description = "Ndimensions Deployment Modules"; 
# $packageNafDeployment.DownloadFolder = "C:\_NAF\Modules\Test\nupkg";
$packageNafDeployment.DownloadFolder = "C:\_NAF\Modules"; 
$packageNafDeployment.ArtifactFeedId = "NdimensionsDeploymentModules"; 
$packageNafDeployment.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageNafDeployment `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageNafDeployment; 

# ********************************************************************************************
# ... Package "Ndimensions.Automation.NafSetup"

[NugetPackage] $packageNafSetup = [NugetPackage]::new(); 
$packageNafSetup.Name = "Ndimensions Automation NAF Setup"; 
$packageNafSetup.BaseName = "Ndimensions.Automation.NafSetup" 
$packageNafSetup.Description = "Bootstrap Module for NAF framework. Hosted on PowerShell Gallery"; 
# $packageNafSetup.DownloadFolder = "C:\_NAF\Application\Ndimensions.Automation.NafSetup\Module";
$packageNafSetup.DownloadFolder = "C:\_NAF\Application\Ndimensions.Automation.NafSetup\Test\nupkg"; 
$packageNafSetup.ArtifactFeedId = "NdimensionsAutomationNafSetup"; 
$packageNafSetup.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageNafSetup `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageNafSetup; 

# ********************************************************************************************
# ... Package "Ndimensions SQLIO Helper"

[NugetPackage] $packageSqlioHelper = [NugetPackage]::new(); 
$packageSqlioHelper.Name = "Ndimensions SQLIO Helper"; 
$packageSqlioHelper.BaseName = "Ndimensions.SQLIO"; 
$packageSqlioHelper.Description = "Ndimensions PowerShell Modules for SQLIO.EXE"; 
# $packageSqlioHelper.DownloadFolder = "C:\_NAF\Modules\Test\nupkg\Ndimensions.SQLIO";
$packageSqlioHelper.DownloadFolder = "C:\_NAF\Application\Ndimensions.Sqlio"; 
$packageSqlioHelper.ArtifactFeedId = "NdimensionsApplicationSqlioHelper"; 
$packageSqlioHelper.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageSqlioHelper `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageSqlioHelper; 

#endregion
#endregion

#region EXPORT

Export-ModuleMember -Variable nugetSettings; 
Export-ModuleMember -Variable artifactSettings; 
Export-ModuleMember -Variable nugetPackages; 

#endregion