Windows_PowerShell_Profile_Loader_Installer.ps1

<#PSScriptInfo
 
.VERSION 1.1.2.0
 
.GUID 1f0e9a08-e0b2-4e3f-8961-165506faf1af
 
.AUTHOR Ruben Kamerman
 
.COMPANYNAME Kamerman Consultancy
 
.COPYRIGHT
 
.TAGS O365 RMS 'Exchange Online' 'SharePoint Online' 'Skype for Business' 'PnP-Powershell' 'Office 365' 'AWSPowerShell' 'Active Directory' 'AADSYNC' 'Server Manager'
 
.LICENSEURI
 
.PROJECTURI
 
.ICONURI
 
.EXTERNALMODULEDEPENDENCIES
 
.REQUIREDSCRIPTS
 
.EXTERNALSCRIPTDEPENDENCIES
 
.RELEASENOTES
V1.1.2.0 Initial build of the PowerShell Profile Loader Installer
 
#>


<#
 
.DESCRIPTION
 Windows_PowerShell Profile Loader Installer
 
#>


#region Run script elevated as Administrator
if ($myWindowsPrincipal.IsInRole($adminRole))
{
    # We are running "as Administrator" - so change the title and background color to indicate this
    $Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Elevated)"
    $Host.UI.RawUI.BackgroundColor = "DarkBlue"
    clear-host
}
else
{
    # We are not running "as Administrator" - so relaunch as administrator
    
    # Create a new process object that starts PowerShell
    $newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell";
    
    # Specify the current script path and name as a parameter
    $newProcess.Arguments = $myInvocation.MyCommand.Definition;
    
    # Indicate that the process should be elevated
    $newProcess.Verb = "runas";
    
    # Start the new process
    [System.Diagnostics.Process]::Start($newProcess);
    
    # Exit from the current, unelevated, process
    exit
}
#endregion Run script elevated as Administrator

#region Global variables
# User profile path
Import-Module PowerShellGet
[string]$UserProfile = $env:USERPROFILE
# User profile windowspowershell path
[string]$UserProfilePSPath = $UserProfile + "\Documents\WindowsPowerShell"
# User profile windowspowershell profile loader path
[string]$UserProfileProfileLoaderPath = $UserProfilePSPath + "\ProfileLoader"
# User profile windowspowershell profile loader install path
[string]$UserProfileProfileLoaderInstallPath = $UserProfileProfileLoaderPath + "\Install"
# User profile windowspowershell scripts path
[string]$UserProfilePSScriptPath = $UserProfilePSPath + "\Scripts"
$HasInternetAccess = ([Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]'{DCB00C01-570F-4A9B-8D69-199FDBA5723B}')).IsConnectedToInternet)
#endregion Global variables

#region Detect PS version and 64-bit OS

Clear-Host
Write-Host ""
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Write-Host " PowerShell Profile Loader Installer - When asked confirm with Y" -ForegroundColor Cyan
Write-Host "#===========================================================================================#" -ForegroundColor Gray

# Check for 64-bit OS
If ($env:PROCESSOR_ARCHITECTURE -match '86')
{
    Write-Host "`nThis script only installs 64-bit modules. This machine is not a 64-bit Operating System.`n" -ForegroundColor Red
    
} # End Check for 64-bit OS

# Check for PowerShell version compatibility
If (($PSVersionTable.PSVersion).Major -le 3.0)
{
    Write-Host "`nThis script requires a version of PowerShell 3 or higher, which this is not.`n" -ForegroundColor Red
    Write-Host "PS 4.0: https://www.microsoft.com/en-us/download/details.aspx?id=40855" -ForegroundColor Yellow
    Write-Host "PS 5.0: https://www.microsoft.com/en-us/download/details.aspx?id=50395" -ForegroundColor Yellow
    Write-Host "Please review the System Requirements to decide which version to install onto your computer.`n" -ForegroundColor Cyan
    Write-Host "#===========================================================================================#" -ForegroundColor Gray
    Write-Host " PowerShell Profile Loader Installer - Install the correct PowerShell Version to continue" -ForegroundColor Cyan
    Write-Host "#===========================================================================================#" -ForegroundColor Gray
    Write-Host ""
    Exit
} # End Check for PowerShell version compatibility

#endregion End Detect PS version and 64-bit OS

#region Detect if the SeverManager module is installed (Remote Server Administration Tools)
# Check if ServerManager Module is installed
function DetectServerManager
{
    If (Get-ModuleStatus â€“name "ServerManager")
    {
        Import-Module ServerManager
    }
    else
    {
        Write-Host "`nThis script requires the Remote Server Administration Tools for your Windows installation.`n" -ForegroundColor Red
        Write-Host "Windows 7: https://www.microsoft.com/en-us/download/details.aspx?id=7887" -ForegroundColor Yellow
        Write-Host "Windows 8.1: https://www.microsoft.com/en-us/download/details.aspx?id=39296" -ForegroundColor Yellow
        Write-Host "https://www.microsoft.com/en-us/download/details.aspx?id=45520" -ForegroundColor Yellow
        Write-Host "Please select the correct version for your Windows OS after installation restart the installer.`n" -ForegroundColor Cyan
        Write-Host "#===========================================================================================#" -ForegroundColor Gray
        Write-Host " PowerShell Profile Loader Installer - Install the correct PowerShell Version to continue" -ForegroundColor Cyan
        Write-Host "#===========================================================================================#" -ForegroundColor Gray
        Write-Host ""
        Exit
    }
}
#endregion Detect if the SeverManager module is installed

#region Test WindowsPowershell path
Function TestWindowsPowershellPath
{
    # Test for target path for install temporary directory.
    If ((Test-Path $UserProfilePSPath) -eq $true)
    {
        Write-Host "Folder: $UserProfilePSPath exists." -ForegroundColor Green
        BackupAndCreateWindowsPowershellPath
    }
    Else
    {
        Write-Host "Folder: $UserProfilePSPath does not exist, creating..." -NoNewline
        New-Item $UserProfilePSPath -type Directory | Out-Null
        Write-Host "created!" -ForegroundColor Green
    }
} #endregion Test WindowsPowershell path

#region backup and create WindowsPowershell path
Function BackupAndCreateWindowsPowershellPath
{
    Write-Host "Backup Folder: $UserProfilePSPath to $UserProfile\Documents\WindowsPowerShell_backup"  -ForegroundColor Green
    Move-Item -Path $UserProfilePSPath -Destination "$UserProfile\Documents\WindowsPowerShell_backup" -Force | Out-Null
    New-Item $UserProfilePSPath -type Directory | Out-Null
    Write-Host "Created Folder: $UserProfilePSPath" -ForegroundColor Green
} #endregion Test WindowsPowershell path

#region Test ProfileLoader path
Function TestProfileLoaderPath
{
    # Test for target path for install temporary directory.
    If ((Test-Path $UserProfileProfileLoaderPath ) -eq $true)
    {
        Write-Host "Folder: $UserProfileProfileLoaderPath exists." -ForegroundColor Green
    }
    Else
    {
        Write-Host "Folder: $UserProfileProfileLoaderPath does not exist, creating..." -NoNewline
        New-Item $UserProfileProfileLoaderPath -type Directory | Out-Null
        Write-Host "created!" -ForegroundColor Green
    }
} #endregion Test ProfileLoader path

#region Test install path
Function TestInstallPath
{
    # Test for target path for install temporary directory.
    If ((Test-Path $UserProfileProfileLoaderInstallPath) -eq $true)
    {
        Write-Host "Folder: $UserProfileProfileLoaderInstallPath exists." -ForegroundColor Green
    }
    Else
    {
        Write-Host "Folder: $UserProfileProfileLoaderInstallPath does not exist, creating..." -NoNewline
        New-Item $UserProfileProfileLoaderInstallPath -type Directory | Out-Null
        Write-Host "created!" -ForegroundColor Green
    }
}#endregion Test install path

#region Install .NET 4.5.2

function Install-DotNET452
{
    $val = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" -Name "Release"
    if ($val.Release -lt "379893")
    {
        GetIt "http://download.microsoft.com/download/E/2/1/E21644B5-2DF2-47C2-91BD-63C560427900/NDP452-KB2901907-x86-x64-AllOS-ENU.exe"
        Set-Location $UserProfileProfileLoaderInstallPath
        [string]$expression = ".\NDP452-KB2901907-x86-x64-AllOS-ENU.exe /quiet /norestart /l* $UserProfileProfileLoaderInstallPath\DotNET452.log"
        Write-Host "File: NDP452-KB2901907-x86-x64-AllOS-ENU.exe installing..." -NoNewLine
        Invoke-Expression $expression
        Start-Sleep -Seconds 20
        Write-Host "`n.NET 4.5.2 should be installed by now." -Foregroundcolor Yellow
    }
    else
    {
        Write-Host "`n.NET 4.5.2 already installed." -Foregroundcolor Green
    }
} #endregion

#region Install Windows Azure Active Directory module

Function Check-SIA_Installed
{
    # Check for Sign In Assistant before WaaD can install
    $CheckForSignInAssistant = Test-Path "HKLM:\SOFTWARE\Microsoft\MSOIdentityCRL"
    If ($CheckForSignInAssistant -eq $true)
    {
        $SignInAssistantVersion = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSOIdentityCRL"
        Write-Host "`Sign In Assistant version"$SignInAssistantVersion.MSOIDCRLVersion"is installed" -Foregroundcolor Green
        Install-WAADModule
    }
    Else
    {
        Write-Host "Windows Azure Active Directory Module stopping installation...`n" -Foregroundcolor Green
        Write-Host "`nThe Sign In Assistant needs to be installed before the Windows Azure Active Directory module.`n" -Foregroundcolor Red
    }
} # End Check for Sign In Assistant before WaaD can install

Function Install-WAADModule
{
    Check-Bits #Confirms if BitsTransfer is running on the local host
    $WAADUrl = "https://bposast.vo.msecnd.net/MSOPMW/Current/amd64/AdministrationConfig-FR.msi"
    Start-BitsTransfer -Source $WAADUrl -Description "Windows Azure Active Directory" -Destination $env:temp -DisplayName "Windows Azure Active Directory"
    Start-Process -FilePath msiexec.exe -ArgumentList "/i $env:temp\$(Split-Path $WAADUrl -Leaf) /quiet /passive"
    Start-Sleep -Seconds 5
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForWAAD = Test-Path "$env:windir\System32\WindowsPowerShell\v1.0\Modules\MSOnline"
        Write-Host "Windows Azure Active Directory Module being installed..." -Foregroundcolor Green
        Start-Sleep -Seconds 10
        $LoopError = $LoopError + 1
    }
    Until ($CheckForWAAD -eq $true -or $LoopError -eq 10)
    Start-Sleep -Seconds 5
    If ($CheckForWAAD -eq $true)
    {
        $WaaDModuleVersion = (get-item C:\Windows\System32\WindowsPowerShell\v1.0\Modules\MSOnline\Microsoft.Online.Administration.Automation.PSModule.dll).VersionInfo.FileVersion
        Write-Host "`nWindows Azure Active Directory Module version $WaaDModuleVersion is now installed." -Foregroundcolor Green
    }
    Else
    {
        Write-Host "`nAn error may have occured. Windows Azure Active Directory online module could be installed or is still installing. Rerun this step to confirm." -ForegroundColor Red
    }
}

Function Install-WindowsAADModule
{
    $CheckForWAAD = Test-Path "$env:windir\System32\WindowsPowerShell\v1.0\Modules\MSOnline"
    If ($CheckForWAAD -eq $false)
    {
        Write-Host "`nWindows Azure Active Directory Module starting installation...`n" -Foregroundcolor Green
        Check-SIA_Installed
    }
    Else
    {
        $WaaDModuleVersion = (get-item C:\Windows\System32\WindowsPowerShell\v1.0\Modules\MSOnline\Microsoft.Online.Administration.Automation.PSModule.dll).VersionInfo.FileVersion
        If ($WaaDModuleVersion -ge "1.0.8070.2")
        {
            Write-Host "`nWindows Azure Active Directory Module version $WaaDModuleVersion already installed." -Foregroundcolor Green
        }
        Else
        {
            Write-Host "`nWindows Azure Active Directory Module version $WaaDModuleVersion already installed." -Foregroundcolor Green
            Write-Host "However, there is a newer version available for download." -ForegroundColor Yellow
            Write-Host "You will need to uninstall your current version and re-install a newer version." -ForegroundColor Yellow
        }
    }
} #endregion Install Windows Azure Active Directory module

#region Install Sign in Assistant (SIA)
Function Install-SIA
{
    Check-Bits #Confirms if BitsTransfer is running on the local host
    $MsolUrl = "http://download.microsoft.com/download/5/0/1/5017D39B-8E29-48C8-91A8-8D0E4968E6D4/en/msoidcli_64.msi"
    Start-BitsTransfer -Source $MsolUrl -Description "Microsoft Online services" -Destination $env:temp -DisplayName "Microsoft Online Services"
    Start-Process -FilePath msiexec.exe -ArgumentList "/i $env:temp\$(Split-Path $MsolUrl -Leaf) /quiet /passive"
    Start-Sleep -Seconds 10
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForSignInAssistant = Test-Path "HKLM:\SOFTWARE\Microsoft\MSOIdentityCRL"
        Write-Host "Sign In Assistant being installed..." -Foregroundcolor Green
        Start-Sleep -Seconds 10
        $LoopError = $LoopError + 1
    }
    Until ($CheckForSignInAssistant -eq $true -or $LoopError -eq 10)
    Start-Sleep -Seconds 10
    If ($CheckForSignInAssistant -eq $true)
    {
        $SignInAssistantVersion = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSOIdentityCRL"
        Write-Host "`nSign In Assistant version"$SignInAssistantVersion.MSOIDCRLVersion"is now installed." -Foregroundcolor Green
        
    }
    Else
    {
        Write-Host "`nAn error may have occured. The Sign In Assistant could be installed or still installing. Rerun this step to confirm." -ForegroundColor Red
    }
    
    
}

Function Install-SignInAssistant
{
    $CheckForSignInAssistant = Test-Path "HKLM:\SOFTWARE\Microsoft\MSOIdentityCRL"
    If ($CheckForSignInAssistant -eq $false)
    {
        Write-Host "`nSign In Assistant starting installation...`n" -Foregroundcolor Green
        Install-SIA
    }
    Else
    {
        $SignInAssistantVersion = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSOIdentityCRL"
        If ($SignInAssistantVersion.MSOIDCRLVersion -lt "7.250.4551.0")
        {
            Write-Host "`nSign In Assistant starting installation...`n" -Foregroundcolor Green
            Install-SIA
        }
        Else
        {
            Write-Host "`nSign In Assistant version"$SignInAssistantVersion.MSOIDCRLVersion"is already installed" -Foregroundcolor Green
        }
    }
} #endregion Install Sign in Assistant

#region Install Skype for Business Module
Function Install-SfbOModule
{
    GetIt "https://download.microsoft.com/download/2/0/5/2050B39B-4DA5-48E0-B768-583533B42C3B/SkypeOnlinePowershell.exe"
    Set-Location $UserProfileProfileLoaderInstallPath
    [string]$expression = ".\SkypeOnlinePowershell.exe /quiet /norestart /l* $UserProfileProfileLoaderInstallPath\SkypeOnlinePowerShell.log"
    Write-Host "Skype for Business online starting installation...`n" -NoNewLine -ForegroundColor Green
    Invoke-Expression $expression
    Start-Sleep -Seconds 5
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForSfbO = Test-Path "$env:ProgramFiles\Common Files\Skype for business Online\Modules"
        Write-Host "Skype for Business online module being installed..." -Foregroundcolor Green
        Start-Sleep -Seconds 15
        $LoopError = $LoopError + 1
    }
    Until ($CheckForSfbO -eq $true -or $LoopError -eq 10)
    If ($CheckForSfbO -eq $true)
    {
        Start-Sleep -Seconds 10
        If ($CheckForSfbO -eq $True)
        {
            Write-Host "Skype for Business online module now installed." -Foregroundcolor Green
        }
        Else
        {
            {
                Write-Host "`nAn error may have occured. Skype for Business online module could be installed or is still installing. Rerun this step to confirm." -ForegroundColor Red
            }
            Write-Host " Reboot eventually needed before this module will work. " -BackgroundColor Red -ForegroundColor Black
        }
    }
}

Function Install-SfbO
{
    $CheckForSfbO = Test-Path "$env:ProgramFiles\Common Files\Skype for business Online\Modules"
    If ($CheckForSfbO -eq $false)
    {
        Install-SfboModule
    }
    Else
    {
        Write-Host "`nSkype for Business Online Module already installed`n" -Foregroundcolor Green
    }
} #endregion Install Skype for Business Module

#region Install SharePoint Module
Function Install-SPOModule
{
    Check-Bits #Confirms if BitsTransfer is running on the local host
    $MsolUrl = "http://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-9846-00-00-03-65-75-65/sharepointonlinemanagementshell_5F00_4613_2D00_1211_5F00_x64_5F00_en_2D00_us.msi"
    Start-BitsTransfer -Source $MsolUrl -Description "SharePoint Online Module" -Destination $env:temp -DisplayName "SharePoint Online Module"
    Start-Process -FilePath msiexec.exe -ArgumentList "/i $env:temp\$(Split-Path $MsolUrl -Leaf) /quiet /passive"
    
    #Logic to confirm that the file downloaded to local client. If not, then launch to website for manual download.
    $CheckForSPOFileDownload = Test-Path "$env:temp\sharepointonlinemanagementshell_5F00_4613_2D00_1211_5F00_x64_5F00_en_2D00_us.msi"
    If ($CheckForSPOFileDownload -eq $false)
    {
        # Install calls download website for install if download file does not exist
        Start-Process "https://www.microsoft.com/en-us/download/details.aspx?id=35588"
    }
    Else
    {
        Start-Sleep -Seconds 5
        $LoopError = 1 # Variable to error out the loop
        Do
        {
            $CheckForSPO = Test-Path "$env:ProgramFiles\SharePoint Online Management Shell"
            Write-Host "SharePoint Online module being installed..." -Foregroundcolor Green
            Start-Sleep -Seconds 5
            $LoopError = $LoopError + 1
        }
        Until ($CheckForSPO -eq $true -or $LoopError -eq 10)
        Start-Sleep -Seconds 10
        If ($CheckForSPO -eq $true)
        {
            Write-Host "`nSharePoint online module installation is now complete." -Foregroundcolor Green
        }
        Else
        {
            Write-Host "`nAn error may have occured. SharePoint online module could be installed. Rerun this step to confirm." -ForegroundColor Red
        }
    }
}

Function Install-SPO
{
    $CheckForSPO = Test-Path "$env:ProgramFiles\SharePoint Online Management Shell"
    If ($CheckForSPO -eq $false)
    {
        Install-SPOModule
        Write-Host " Reboot eventually needed before this module will work. " -BackgroundColor Red -ForegroundColor Black
    }
    Else
    {
        Write-Host "`nSharePoint Online Module already installed." -Foregroundcolor Green
    }
    
} #endregion Install SharePoint Module

#region Install ProfileLoader

# ProfileLoader download and extraction
Function Install-ProfileLoader
{
    $url = "http://10.44.30.94/ProfileLoader.zip" 
    $output = $env:TEMP
    Import-Module BitsTransfer
    Start-BitsTransfer -Source $url -Destination $output
    
    function Expand-ZIPFile($file, $destination)
    {
        $shell = new-object -com shell.application
        $zip = $shell.NameSpace($file)
        foreach ($item in $zip.items())
        {
            $shell.Namespace($destination).copyhere($item)
        }
    }
    
    Expand-ZIPFile â€“File "$output\ProfileLoader.zip" â€“Destination $UserProfilePSPath
    Start-Sleep -Seconds 2
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForProfileLoader = Test-Path "$UserProfileProfileLoaderPath\PowerShellProfileLoader.exe"
        Write-Host "Windows PowerShell Profile Loader being installed..." -Foregroundcolor Green
        Start-Sleep -Seconds 2
        $LoopError = $LoopError + 1
    }
    Until ($CheckForProfileLoader -eq $true -or $LoopError -eq 10)
    Start-Sleep -Seconds 2
    If ($CheckForProfileLoader -eq $true)
    {
        Write-Host "`nWindows PowerShell Profile Loader now installed." -Foregroundcolor Green
    }
    Else
    {
        Write-Host "`nAn error may have occured. Windows PowerShell Profile Loader could be installed or is still installing. Rerun this step to confirm." -ForegroundColor Red
    }
    
} # End O365_Logon Module download and extraction
#endregion End Install ProfileLoader

#region Install Azure Module
function Install-AzureModule
{
    Write-Host "Windows Azure Resource Manager module being installed..." -Foregroundcolor Green
    Install-Module -Name "AzureRM" -Scope CurrentUser -Force -Confirm:$false
    Start-Sleep -Seconds 2
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForAzureRM = Test-Path "$UserProfilePSPath\Modules\AzureRM"
        Start-Sleep -Seconds 2
        $LoopError = $LoopError + 1
    }
    Until ($CheckForAzureRM -eq $true -or $LoopError -eq 10)
    Start-Sleep -Seconds 2
    If ($CheckForAzureRM -eq $true)
    {
        Write-Host "`nWindows Azure Resource Manager module being installed now installed." -Foregroundcolor Green
    }
    Else
    {
        Write-Host "`nAn error may have occured. Windows Azure Resource Manager module could be installed or is still installing. Rerun this step to confirm." -ForegroundColor Red
    }
    Write-Host "Windows Azure(Classic) module being installed..." -Foregroundcolor Green
    Install-Module -Name "Azure" -Scope CurrentUser -Force -Confirm:$false
    Start-Sleep -Seconds 2
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForAzureClassic = Test-Path "$UserProfilePSPath\Modules\Azure"
        Start-Sleep -Seconds 2
        $LoopError = $LoopError + 1
    }
    Until ($CheckForAzureClassic -eq $true -or $LoopError -eq 10)
    Start-Sleep -Seconds 2
    If ($CheckForAzureClassic -eq $true)
    {
        Write-Host "`nWindows Azure(Classic) module being installed now installed." -Foregroundcolor Green
    }
    Else
    {
        Write-Host "`nAn error may have occured. Windows Azure(Classic) module could be installed or is still installing. Rerun this step to confirm." -ForegroundColor Red
    }
}
#endregion Install Azure Module

#region Install AWS Module
function Install-AWSModule
{
    Write-Host "Amazon Web Services module being installed..." -Foregroundcolor Green
    Install-Module -Name "AWSPowerShell" -Scope CurrentUser -Force -Confirm:$false
    Start-Sleep -Seconds 2
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForAWS = Test-Path "$UserProfilePSPath\Modules\AWSPowerShell"
        Start-Sleep -Seconds 2
        $LoopError = $LoopError + 1
    }
    Until ($CheckForAWS -eq $true -or $LoopError -eq 10)
    Start-Sleep -Seconds 2
    If ($CheckForAWS -eq $true)
    {
        Write-Host "`nAmazon Web Services module being installed now installed." -Foregroundcolor Green
    }
    Else
    {
        Write-Host "`nAn error may have occured. Amazon Web Services module could be installed or is still installing. Rerun this step to confirm." -ForegroundColor Red
    }
}
#endregion Install AWS Module

#region Install RSAT-AD-PowerShell Module
function Install-RSAT-AD-PowerShell
{
    Write-Host "Microsoft Active Directory management module being installed..." -Foregroundcolor Green
    Add-WindowsFeature RSAT-AD-PowerShell -Confirm:$false -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
    Start-Sleep -Seconds 2
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForRSATDHCP = Get-ModuleStatus -name ActiveDirectory
        Start-Sleep -Seconds 2
        $LoopError = $LoopError + 1
    }
    Until ($CheckForRSATDHCP -eq $true -or $LoopError -eq 10)
    Start-Sleep -Seconds 2
    If ($CheckForRSATDHCP -eq $true)
    {
        Write-Host "`nMicrosoft Active Directory management module being installed now installed." -Foregroundcolor Green
    }
    Else
    {
        Write-Host "`nAn error may have occured. Microsoft Active Directory management module could be installed or is still installing. Rerun this step to confirm." -ForegroundColor Red
    }
}
#endregion Install RSAT-AD-PowerShell Module

#region Install RSAT-DHCP Module
function Install-RSAT-DHCP
{
    Write-Host "Microsoft DHCP Server management module being installed..." -Foregroundcolor Green
    Add-WindowsFeature RSAT-DHCP -Confirm:$false -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
    Start-Sleep -Seconds 2
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForRSATDHCP = Get-ModuleStatus -name DhcpServer
        Start-Sleep -Seconds 2
        $LoopError = $LoopError + 1
    }
    Until ($CheckForRSATDHCP -eq $true -or $LoopError -eq 10)
    Start-Sleep -Seconds 2
    If ($CheckForRSATDHCP -eq $true)
    {
        Write-Host "`nMicrosoft DHCP Server management module being installed now installed." -Foregroundcolor Green
    }
    Else
    {
        Write-Host "`nAn error may have occured. Microsoft DHCP Server management module could be installed or is still installing. Rerun this step to confirm." -ForegroundColor Red
    }
}
#endregion Install RSAT-DHCP Module

#region Install RSAT-DNS-Server Module
function Install-RSAT-DNS-Server
{
    Write-Host "Microsoft DNS Server management module being installed..." -Foregroundcolor Green
    Add-WindowsFeature RSAT-DNS-Server -Confirm:$false -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
    Start-Sleep -Seconds 2
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForRSATDNSServer = Get-ModuleStatus -name DnsServer
        Start-Sleep -Seconds 2
        $LoopError = $LoopError + 1
    }
    Until ($CheckForRSATDNSServer -eq $true -or $LoopError -eq 10)
    Start-Sleep -Seconds 2
    If ($CheckForRSATDNSServer -eq $true)
    {
        Write-Host "`nMicrosoft DNS Server management module being installed now installed." -Foregroundcolor Green
    }
    Else
    {
        Write-Host "`nAn error may have occured. Microsoft DNS Server management module could be installed or is still installing. Rerun this step to confirm." -ForegroundColor Red
    }
}
#endregion Install RSAT-DNS-Server Module

#region Install RSAT-DFS-Mgmt-Con Module
function Install-RSAT-DFS-Mgmt-Con
{
    Write-Host "Microsoft DFS Server management module being installed..." -Foregroundcolor Green
    Add-WindowsFeature RSAT-DFS-Mgmt-Con -Confirm:$false -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
    Start-Sleep -Seconds 2
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForRSATDFSMgmtCon = Get-ModuleStatus -name DFSN
        Start-Sleep -Seconds 2
        $LoopError = $LoopError + 1
    }
    Until ($CheckForRSATDFSMgmtCon -eq $true -or $LoopError -eq 10)
    Start-Sleep -Seconds 2
    If ($CheckForRSATDFSMgmtCon -eq $true)
    {
        Write-Host "`nMicrosoft DFS Server management module being installed now installed." -Foregroundcolor Green
    }
    Else
    {
        Write-Host "`nAn error may have occured. Microsoft DFS Server management module could be installed or is still installing. Rerun this step to confirm." -ForegroundColor Red
    }
}
#endregion Install RSAT-DFS-Mgmt-Con Module

#region Install UpdateServices-RSAT Module
function Install-UpdateServices-RSAT
{
    Write-Host "Microsoft Windows Update Services management module being installed..." -Foregroundcolor Green
    Add-WindowsFeature UpdateServices-RSAT -Confirm:$false -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
    Start-Sleep -Seconds 2
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForUpdateServicesRSAT = Get-ModuleStatus -name UpdateServices
        Start-Sleep -Seconds 2
        $LoopError = $LoopError + 1
    }
    Until ($CheckForUpdateServicesRSAT -eq $true -or $LoopError -eq 10)
    Start-Sleep -Seconds 2
    If ($CheckForUpdateServicesRSAT -eq $true)
    {
        Write-Host "`nMicrosoft Windows Update Services management module being installed now installed." -Foregroundcolor Green
    }
    Else
    {
        Write-Host "`nAn error may have occured. Microsoft Windows Update Services management module could be installed or is still installing. Rerun this step to confirm." -ForegroundColor Red
    }
}
#endregion Install UpdateServices-RSAT Module

#region Install GPMC Module
function Install-GPMC
{
    Write-Host "Microsoft Group Policy Management Console module being installed..." -Foregroundcolor Green
    Add-WindowsFeature GPMC -Confirm:$false -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
    Start-Sleep -Seconds 2
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForGPMC = Get-ModuleStatus -name GPMC
        Start-Sleep -Seconds 2
        $LoopError = $LoopError + 1
    }
    Until ($CheckForGPMC -eq $true -or $LoopError -eq 10)
    Start-Sleep -Seconds 2
    If ($CheckForGPMC -eq $true)
    {
        Write-Host "`nMicrosoft Group Policy Management Console module being installed now installed." -Foregroundcolor Green
    }
    Else
    {
        Write-Host "`nAn error may have occured. Microsoft Group Policy Management Console module could be installed or is still installing. Rerun this step to confirm." -ForegroundColor Red
    }
}
#endregion Install GPMC Module

#region Install Connect-O365 Script
function Install-Connect_O365
{
    Write-Host "Office 365 Logon Script being installed..." -Foregroundcolor Green
    Install-Script -Name "Connect-O365" -Scope CurrentUser -Force -Confirm:$false
    Start-Sleep -Seconds 2
    $LoopError = 1 # Variable to error out the loop
    Do
    {
        $CheckForO365Logon = Test-Path "$UserProfilePSPath\Scripts\Connect-O365.ps1"
        Start-Sleep -Seconds 2
        $LoopError = $LoopError + 1
    }
    Until ($CheckForO365Logon -eq $true -or $LoopError -eq 10)
    Start-Sleep -Seconds 2
    If ($CheckForO365Logon -eq $true)
    {
        Write-Host "`nOffice 365 Logon Script being installed now installed." -Foregroundcolor Green
    }
    Else
    {
        Write-Host "`nAn error may have occured. Office 365 Logon Script could be installed or is still installing. Rerun this step to confirm." -ForegroundColor Red
    }
}
#endregion Install Connect-O365 Script

#region Misc functions
# Get-Bits function
Function Check-Bits
{
    if ((Get-Module BitsTransfer) -eq $null)
    {
        Write-Host "BitsTransfer: Installing..." -NoNewLine
        Import-Module BitsTransfer
        Write-Host "Installed." -ForegroundColor Green
    }
} # End Get-Bits Function

# GetIt Module
function GetIt ([string]$sourcefile)
{
    if ($HasInternetAccess)
    {
        Check-Bits # check if BitsTransfer is installed
        [string]$targetfile = $sourcefile.Substring($sourcefile.LastIndexOf("/") + 1)
        if (Test-Path "$UserProfileProfileLoaderInstallPath\$targetfile")
        {
            Write-Host "File: $targetfile exists."
        }
        else
        {
            Write-Host "File: $targetfile does not exist, downloading..." -NoNewLine
            Start-BitsTransfer -Source "$SourceFile" -Destination "$UserProfileProfileLoaderInstallPath\$targetfile"
            Write-Host "Downloaded." -ForegroundColor Green
        }
    }
    else
    {
        Write-Host "Internet Access not detected. Please resolve and try again." -foregroundcolor red
    }
} # End GetIt Module function

# Unzip function
function UnZipIt ([string]$source, [string]$target)
{
    if (Test-Path "$UserProfileProfileLoaderInstallPath\$target")
    {
        Write-Host "File: $target exists."
    }
    else
    {
        Write-Host "File: $target doesn't exist, unzipping..." -NoNewLine
        $sh = new-object -com shell.application
        $zipfolder = $sh.namespace("$UserProfileProfileLoaderInstallPath\$source")
        $item = $zipfolder.parsename("$target")
        $UserProfileProfileLoaderInstallPath2 = $sh.namespace("$UserProfileProfileLoaderInstallPath")
        Set-Location $UserProfileProfileLoaderInstallPath
        $UserProfileProfileLoaderInstallPath2.copyhere($item)
        Write-Host "`b`b`b`b`b`b`b`b`b`b`b`bunzipped! " -ForegroundColor Green
        Remove-Item $source
    }
} # End UnZipIt Function

# New-FileDownload function
function New-FileDownload
{
    param (
        [parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true, HelpMessage = "No source file specified")]
        [string]$SourceFile,
        [parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false, HelpMessage = "No destination folder specified")]
        [string]$DestFolder,
        [parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false, HelpMessage = "No destination file specified")]
        [string]$DestFile
    )
    $error.clear()
    if (!($DestFolder)) { $DestFolder = $UserProfileProfileLoaderInstallPath }
    Get-ModuleStatus -name BitsTransfer
    if (!($DestFile)) { [string]$DestFile = $SourceFile.Substring($SourceFile.LastIndexOf("/") + 1) }
    if (Test-Path $DestFolder)
    {
        Write-Host "Folder: `"$DestFolder`" exists."
    }
    else
    {
        Write-Host "Folder: `"$DestFolder`" does not exist, creating..." -NoNewline
        New-Item $DestFolder -type Directory
        Write-Host "Done! " -ForegroundColor Green
    }
    if (Test-Path "$DestFolder\$DestFile")
    {
        Write-Host "File: $DestFile exists."
    }
    else
    {
        if ($HasInternetAccess)
        {
            Write-Host "File: $DestFile does not exist, downloading..." -NoNewLine
            Start-BitsTransfer -Source "$SourceFile" -Destination "$DestFolder\$DestFile"
            Write-Host "Done! " -ForegroundColor Green
        }
        else
        {
            Write-Host "Internet access not detected. Please resolve and try again." -ForegroundColor red
        }
    }
} # End New-FileDownload funtion

# Function Get-ModuleStatus
function Get-ModuleStatus
{
    param (
        [parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true, HelpMessage = "No module name specified!")]
        [string]$name
    )
    if (!(Get-Module -name "$name"))
    {
        if (Get-Module -ListAvailable | ? { $_.name -eq "$name" })
        {
            Import-Module -Name "$name"
            # module was imported
            return $true
        }
        else
        {
            # module was not available
            return $false
        }
    }
    else
    {
        # module was already imported
        # Write-Host "$name module already imported"
        return $true
    }
} # End Function Get-ModuleStatus function
#endregion Misc functions

#region Script init
Clear-Host
DetectServerManager
Write-Host ""
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Write-Host " PowerShell Profile Loader Installer" -ForegroundColor Cyan
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Write-Host " Backup old WindowsPowerShell directory in profile and create new" -ForegroundColor Cyan
Write-Host ""
TestWindowsPowershellPath
TestProfileLoaderPath
TestInstallPath
Write-Host ""
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Write-Host " Install Microsoft Management Modules"
Write-Host ""
Install-RSAT-AD-PowerShell
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Install-RSAT-DHCP
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Install-RSAT-DNS-Server
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Install-RSAT-DFS-Mgmt-Con
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Install-UpdateServices-RSAT
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Install-GPMC
Write-Host ""
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Write-Host " Install Office 365 Management Modules"
Write-Host ""
Install-SIA
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Install-WindowsAADModule
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Install-SfbOModule
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Install-SPOModule
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Install-Connect_O365
Write-Host ""
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Write-Host " Install Azure and AWS Management Modules"
Write-Host ""
Install-AzureModule
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Install-AWSModule
Write-Host ""
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Write-Host " Install Profile Loader"
Write-Host ""
Install-ProfileLoader
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Write-Host " PowerShell Profile Loader Installer - Completed!" -ForegroundColor Cyan
Write-Host "#===========================================================================================#" -ForegroundColor Gray
Write-Host ""
#endregion Script INIT

# SIG # Begin signature block
# MIISvwYJKoZIhvcNAQcCoIISsDCCEqwCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQU3WTVKL+U6FYEhuaarv8XB8ah
# n0Oggg2KMIIEFDCCAvygAwIBAgILBAAAAAABL07hUt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