Ndimensions.Automation.NafSetup.psm1

<#
    .SYNOPSIS
    Ndimensions Automation Framework Setup
 
    .DESCRIPTION
    Ndimensions Automation Framework Setup. The NAF is hosted on MS PS Gallery and resposisble to provide a way to
    - Prepare a machine for downloading git repositories
    - Installs git related client software
    - Downloads the NAF repositories from Azure Artifacts
 
    .NOTES
    Author : hillesheim@n-dimensions.de
    Version : 2.14
    DateLastChanged : 2024-11-11
#>
 

Write-Host "Load module 'Ndimensions.Automation.NafSetup' (2.14.) ... "

# ********************************************************************************************
# ********************************************************************************************
#region 01-DECLARATION

#region 01-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"; 

#endregion

#region 02-SYSTEM_VARIBLES

# ********************************************************************************
# 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"; 

#endregion

# ********************************************************************************************
# ********************************************************************************************
#region 03-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"; 
$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"; 
$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.ArtifactFeedId = "NdimensionsAutomationNafSetup"; 
$packageNafSetup.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageNafSetup `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageNafSetup; 

# ********************************************************************************************
# ... Package "Ndimensions.Automation.ClassroomSetup"

[NugetPackage] $packageClassroomSetup = [NugetPackage]::new(); 
$packageClassroomSetup.Name = "Ndimensions Automation Classroom Setup"; 
$packageClassroomSetup.BaseName = "Ndimensions.Automation.ClassroomSetup" 
$packageClassroomSetup.Description = "PowerShell scripts to run the classroom setup on master and satellite. Hosted on Azure Artifacts"; 
$packageClassroomSetup.DownloadFolder = "C:\_NAF\Application\Ndimensions.Automation.ClassroomSetup\Module"; 
$packageClassroomSetup.ArtifactFeedId = "NdimensionsAutomationClassroomSetup"; 
$packageClassroomSetup.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageClassroomSetup `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageClassroomSetup; 

# ********************************************************************************************
# ... Package "Ndimensions Classroom Server"

[NugetPackage] $packageClassroomServer = [NugetPackage]::new(); 
$packageClassroomServer.Name = "Ndimensions Classroom Server"; 
$packageClassroomServer.BaseName = "Ndimensions.Classroom.Server"; 
$packageClassroomServer.Description = "Ndimensions Classroom Server"; 
$packageClassroomServer.DownloadFolder = "C:\_NAF\Application\Ndimensions.Classroom.Server\Application"; 
$packageClassroomServer.ArtifactFeedId = "NdimensionsClassroomServer"; 
$packageClassroomServer.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageClassroomServer `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageClassroomServer; 

# ********************************************************************************************
# ... Package "Ndimensions DISKSPD Helper"

[NugetPackage] $packageDiskspdHelper = [NugetPackage]::new(); 
$packageDiskspdHelper.Name = "Ndimensions DISKSPD Helper"; 
$packageDiskspdHelper.BaseName = "Ndimensions.DiskSpd"; 
$packageDiskspdHelper.Description = "Ndimensions PowerShell Modules for DISKSPD.EXE"; 
$packageDiskspdHelper.DownloadFolder = "C:\_NAF\Application\Ndimensions.DiskSpd"; 
$packageDiskspdHelper.ArtifactFeedId = "NdimensionsApplicationDiskSpdHelper"; 
$packageDiskspdHelper.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageDiskspdHelper `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageDiskspdHelper; 

# ********************************************************************************************
# ... 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\Application\Ndimensions.Sqlio"; 
$packageSqlioHelper.ArtifactFeedId = "NdimensionsApplicationSqlioHelper"; 
$packageSqlioHelper.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageSqlioHelper `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageSqlioHelper; 

# ********************************************************************************************
# ... Package "Ndimensions Mouse Context Items Helper"

[NugetPackage] $packageMouseContext = [NugetPackage]::new(); 
$packageMouseContext.Name = "Ndimensions Mouse Context Items Helper";
$packageMouseContext.BaseName = "Ndimensions.Helper.MouseContextItems"; 
$packageMouseContext.Description = "Ndimensions PowerShell Application for Mouse Context Items"; 
$packageMouseContext.DownloadFolder = "C:\_NAF\Application\Ndimensions.Helper.MouseContextItems\Module"; 
$packageMouseContext.ArtifactFeedId = "NdimensionsHelperMouseContextItems"; 
                                       
$packageMouseContext.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageMouseContext `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageMouseContext; 

# ********************************************************************************************
# ... Package "Ndimensions.Helper.TextToTable"

[NugetPackage] $packageTextToTable = [NugetPackage]::new(); 
$packageTextToTable.Name = "Ndimensions Text-to-Table Helper"; 
$packageTextToTable.BaseName = "Ndimensions.Helper.TextToTable"; 
$packageTextToTable.Description = "Ndimensions PowerShell Application for Mouse Context Items"; 
$packageTextToTable.DownloadFolder = "C:\_NAF\Application\Ndimensions.Helper.TextToTable\Module"; 
$packageTextToTable.ArtifactFeedId = "NdimensionsHelperTextToTable"; 
$packageTextToTable.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageTextToTable `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageTextToTable; 

# ********************************************************************************************
# ... Package "Ndimensions.Helper.Qa"

[NugetPackage] $packageQa = [NugetPackage]::new(); 
$packageQa.Name = "Ndimensions QA Helper"; 
$packageQa.BaseName = "Ndimensions.Helper.Qa"; 
$packageQa.Description = "Ndimensions QA Helper"; 
$packageQa.DownloadFolder = "C:\_NAF\Application\Ndimensions.Helper.Qa\Module"; 
$packageQa.ArtifactFeedId = "NdimensionsHelperQa"; 
$packageQa.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageQa `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageQa; 

# ********************************************************************************************
# ... Package "Ndimensions.Helper.HtmlSlides"

[NugetPackage] $packageHtmlSlides = [NugetPackage]::new(); 
$packageHtmlSlides.Name = "Ndimensions Html Slides Helper"; 
$packageHtmlSlides.BaseName = "Ndimensions.Helper.HtmlSlides"; 
$packageHtmlSlides.Description = "Ndimensions Html Slides Helper"; 
$packageHtmlSlides.DownloadFolder = "C:\_NAF\Application\Ndimensions.Helper.HtmlSlides\Module"; 
$packageHtmlSlides.ArtifactFeedId = "NdimensionsHelperHtmlSlides"; 
$packageHtmlSlides.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageHtmlSlides `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageHtmlSlides; 

# ********************************************************************************************
# ... Package "Ndimensions.Automation.PyApp"

[NugetPackage] $packagePyApp = [NugetPackage]::new(); 
$packagePyApp.Name = "Ndimensions Python App"; 
$packagePyApp.BaseName = "Ndimensions.Automation.PyApp"; 
$packagePyApp.DownloadFolder = "C:\_NAF\Application\Ndimensions.Automation.PyApp\Module"; 
$packagePyApp.ArtifactFeedId = "NdimensionsAutomationPyApp"; 
$packagePyApp.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packagePyApp `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packagePyApp; 

# ********************************************************************************************
# ... Package "Ndimensions.Helper.Encrypt"

[NugetPackage] $packageEncrypt = [NugetPackage]::new(); 
$packageEncrypt.Name = "Ndimensions Encryption Helper"; 
$packageEncrypt.BaseName = "Ndimensions.Helper.Encrypt"; 
$packageEncrypt.DownloadFolder = "C:\_NAF\Application\Ndimensions.Helper.Encrypt\Module"; 
$packageEncrypt.ArtifactFeedId = "NdimensionsHelperEncrypt"; 
$packageEncrypt.ArtifactFeedUrl = `
    Get-ArtifactFeedUrl `
        -NugetPackage $packageEncrypt `
        -ArtifactSettings $artifactSettings; 

$nugetPackages += $packageEncrypt; 

#endregion

# ********************************************************************************************

#endregion
#endregion

#region 02-EXPORT

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

#endregion