DeployEverything Dell Driver Download Automation Tool

Our previously created PowerShell script has been wrapped into a GUI and provides additional functionality that you requested, including the ability to manually select the models you wish to download drivers/bios updates for.

The tool automates the following processes;

  1. Query SCCM for a full list of Dell enterprise client products (Optiplex & Latitude) or Import CSV file containing your Dell models for MDT
  2. Download BIOS updates for each model
  3. Creates a PowerShell Script for the BIOS update This allows you to deploy a package in SCCM with a program entry pointing to the PS script. As the PS script is updated with each version, you never need to worry about updating this.
  4. Create a BIOS Update Package based on machine mode
  5. Download Driver CAB for each model
  6. Extract the Driver CAB
  7. Import the drivers in the extracted CAB folder
  8. Create a Category based on the machine model
  9. Create a Driver Package based on the machine model and filename
  10. Imports the associated drivers into the newly created Driver Package

<# .NOTES ——————————————————————————– Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.134 Generated on: 27/01/2017 12:31 Generated by: Maurice.Daly File Name: DellAutoDownloadGUI.ps1 Version: 1.2 ——————————————————————————– .DESCRIPTION This script allows you to automate the process of keeping your Dell driver and BIOS update sources up to date. The script reads the Dell SCCM driver pack site for models you have specified and then downloads the corresponding latest driver packs and BIOS updates.

	The script generates a GUI allowing you to select features such as SCCM or
	MDT import jobs, Operating System, Driver or BIOS downloads etc.
	
	Use : This script is provided as it and I accept no responsibility for any issues arising from its use.
 
	Twitter : @modaly\_it
	Blog : http://deployeverything.com
 
	Credits
	MDT Import Script Source - https://scriptimus.wordpress.com/2012/06/18/mdt-powershell-importing-drivers/
	SCCM Model Query Script - http://www.scconfigmgr.com/2015/04/14/get-device-models-in-configmgr-2012-with-powershell/ 

	ChangeLog
	
	Version 1.0 Initial Release
	Version 1.1 Changed style to tabs and added support for selecting unknown 
				models from the full Dell Optiplex, Latitude and Precision 
				Workstation model list.
				
				Added fix up logic for model AIO, 2-in-1 and other non-standard
				models when downloading SCCM driver packs.
	Version 1.2 Bug Fixes
	Version 1.3 Added Log File Creation #>

#region Source: Startup.pss #region File Recovery Data (DO NOT MODIFY) #endregion #———————————————- #region Import Assemblies #———————————————- [void][Reflection.Assembly]::Load(‘System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’) [void][Reflection.Assembly]::Load(‘System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’) [void][Reflection.Assembly]::Load(‘System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’) [void][Reflection.Assembly]::Load(‘System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’) #endregion Import Assemblies

#Define a Param block to use custom parameters in the project #Param ($CustomParameter)

function Main { <# .SYNOPSIS The Main function starts the project application.

.PARAMETER Commandline
    $Commandline contains the complete argument string passed to the script packager executable.

.NOTES
    Use this function to initialize your script and to call GUI forms.
	
.NOTES
    To get the console output in the Packager (Forms Engine) use: 
	$ConsoleOutput (Type: System.Collections.ArrayList) #>
Param (\[String\]$Commandline)
	
if((Show-MainForm\_psf) -eq 'OK')
{
	
}

$script:ExitCode = 0 #Set the exit code for the Packager }

#endregion Source: Startup.pss

#region Source: MainForm.psf function Show-MainForm_psf { #———————————————- #region Import the Assemblies #———————————————- [void][reflection.assembly]::Load(‘System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’) [void][reflection.assembly]::Load(‘System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’) [void][reflection.assembly]::Load(‘System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’) [void][reflection.assembly]::Load(‘System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’) #endregion Import Assemblies

#----------------------------------------------
#region Define SAPIEN Types
#----------------------------------------------
try{
	\[ProgressBarOverlay\] | Out-Null
}
catch
{
	Add-Type -ReferencedAssemblies ('System.Windows.Forms', 'System.Drawing') -TypeDefinition  @" 
	using System;
	using System.Windows.Forms;
	using System.Drawing;
    namespace SAPIENTypes
    {
	    public class ProgressBarOverlay : System.Windows.Forms.ProgressBar
        {
            public ProgressBarOverlay() : base() { SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); }
            protected override void WndProc(ref Message m)
            { 
                base.WndProc(ref m);
                if (m.Msg == 0x000F)// WM\_PAINT
                {
                    if (Style != System.Windows.Forms.ProgressBarStyle.Marquee || !string.IsNullOrEmpty(this.Text))
                    {
                        using (Graphics g = this.CreateGraphics())
                        {
                            using (StringFormat stringFormat = new StringFormat(StringFormatFlags.NoWrap))
                            {
                                stringFormat.Alignment = StringAlignment.Center;
                                stringFormat.LineAlignment = StringAlignment.Center;
                                if (!string.IsNullOrEmpty(this.Text))
                                    g.DrawString(this.Text, this.Font, Brushes.Black, this.ClientRectangle, stringFormat);
                                else
                                {
                                    int percent = (int)(((double)Value / (double)Maximum) \* 100);
                                    g.DrawString(percent.ToString() + "%", this.Font, Brushes.Black, this.ClientRectangle, stringFormat);
                                }
                            }
                        }
                    }
                }
            }
          
            public string TextOverlay
            {
                get
                {
                    return base.Text;
                }
                set
                {
                    base.Text = value;
                    Invalidate();
                }
            }
        }
    } "@ -IgnoreWarnings | Out-Null
}
#endregion Define SAPIEN Types

#----------------------------------------------
#region Generated Form Objects
#----------------------------------------------
\[System.Windows.Forms.Application\]::EnableVisualStyles()
$MainForm = New-Object 'System.Windows.Forms.Form'
$SCCMDellTabControl = New-Object 'System.Windows.Forms.TabControl'
$SCCMTabPage1 = New-Object 'System.Windows.Forms.TabPage'
$SiteCodeText = New-Object 'System.Windows.Forms.TextBox'
$SiteServerInput = New-Object 'System.Windows.Forms.TextBox'
$FindModelsButton = New-Object 'System.Windows.Forms.Button'
$SiteCodeLabel = New-Object 'System.Windows.Forms.Label'
$SiteServerLabel = New-Object 'System.Windows.Forms.Label'
$SCCMTabPage2 = New-Object 'System.Windows.Forms.TabPage'
$FindDellModelsButton = New-Object 'System.Windows.Forms.Button'
$labelAvailableModels = New-Object 'System.Windows.Forms.Label'
$AddToListlButton = New-Object 'System.Windows.Forms.Button'
$DellModelListComboBox = New-Object 'System.Windows.Forms.ComboBox'
$SCCMTabPage3 = New-Object 'System.Windows.Forms.TabPage'
$MDTPathLabel = New-Object 'System.Windows.Forms.Label'
$MDTBrowseButton = New-Object 'System.Windows.Forms.Button'
$labelPleaseNoteThisToolIs = New-Object 'System.Windows.Forms.Label'
$ClearSelectionButton = New-Object 'System.Windows.Forms.Button'
$ModelProgressOverlay = New-Object 'SAPIENTypes.ProgressBarOverlay'
$ProgressBar = New-Object 'System.Windows.Forms.ProgressBar'
$ProgressListBox = New-Object 'System.Windows.Forms.ListBox'
$AboutToolLabel = New-Object 'System.Windows.Forms.Label'
$AutomationLabel = New-Object 'System.Windows.Forms.Label'
$picturebox1 = New-Object 'System.Windows.Forms.PictureBox'
$labelDeployEverythingcom = New-Object 'System.Windows.Forms.Label'
$ProductListBox = New-Object 'System.Windows.Forms.ListBox'
$StartDownloadButton = New-Object 'System.Windows.Forms.Button'
$DownloadGroupBox = New-Object 'System.Windows.Forms.GroupBox'
$ArchitectureComboxBox = New-Object 'System.Windows.Forms.ComboBox'
$DownloadComboBox = New-Object 'System.Windows.Forms.ComboBox'
$PlatformComboBox = New-Object 'System.Windows.Forms.ComboBox'
$PackagePathTextBox = New-Object 'System.Windows.Forms.TextBox'
$RepositoryTextBox = New-Object 'System.Windows.Forms.TextBox'
$OSComboBox = New-Object 'System.Windows.Forms.ComboBox'
$PackagePathLabel = New-Object 'System.Windows.Forms.Label'
$RepositoryLabel = New-Object 'System.Windows.Forms.Label'
$ArchitectureCheckBox = New-Object 'System.Windows.Forms.Label'
$lSelectDeployLabel = New-Object 'System.Windows.Forms.Label'
$OperatingSysLabel = New-Object 'System.Windows.Forms.Label'
$labelDownloadType = New-Object 'System.Windows.Forms.Label'
$ModelListBox = New-Object 'System.Windows.Forms.Label'
$LoggingLabel = New-Object 'System.Windows.Forms.Label'
$ModelProgressLabel = New-Object 'System.Windows.Forms.Label'
$OpenMDTFileDialog = New-Object 'System.Windows.Forms.OpenFileDialog'
$InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
#endregion Generated Form Objects

#----------------------------------------------
# User Generated Script
#----------------------------------------------
$MainForm\_Load = {
	
	# Create Log File
	Get-Date -Format F | Out-File -FilePath $LogFile -Append
	Add-Content -Path $LogFile "Logging Running....."
	Add-Content -Path $LogFile " "
	
	# Set SCCM Site Server To Local Machine
	$SiteServerInput.Text = $env:COMPUTERNAME
	
}

$StartDownloadButton\_Click = {
	
	# Set Variables Retrieved From GUI
	$ImportInto = \[string\]$PlatformComboBox.SelectedItem
	$DownloadType = \[string\]$DownloadComboBox.SelectedItem
	$DellProducts = $ProductListBox.SelectedItems
	$SiteCode = $SiteCodeText.Text
	
	# Set Initial Validation State
	$ValidationErrors = 0
	
	# ============ Validation Selection Details and Prerequisites ==============
	
	# Reset Job Process Log Dialog 
	if (($ProgressListBox.ForeColor) -eq "Red") { $ProgressListBox.Items.Clear() }
	
	# Validate Selected Models
	if (($ProductListBox.SelectedItems.Count) -lt "1")
	{
		$ProgressListBox.ForeColor = "Red"
		$ProgressListBox.Items.Add("Error: No Models Selected")
		$ValidationErrors++
	}
	
	# Validate Repository Path For BIOS & Driver Downloads
	if ((Test-Path -Path $RepositoryTextBox.Text) -eq $true)
	{
		$RepositoryPath = \[string\]$RepositoryTextBox.Text
		$ProgressListBox.Items.Add("MDT: Respository Path Set To $RepositoryPath")
	}
	else
	{
		$ProgressListBox.ForeColor = "Red"
		$ProgressListBox.Items.Add("Error: UNC Repository Path Specified Could Not Be Found $($RepositoryTextBox.Text)")
		$ValidationErrors++
	}
	
	# Validate Package Path For SCCM Driver Imports
	if (($ImportInto) -ne "MDT")
	{
		if ((Test-Path -path $PackagePathTextBox.Text) -eq $true)
		{
			$PackagePath = \[string\]$PackagePathTextBox.Text
		}
		else
		{
			$ProgressListBox.ForeColor = "Red"
			$ProgressListBox.Items.Add("Error: UNC Package Path Specified Could Not Be Found $($PackagePathTextBox.Text)")
			$ValidationErrors++
		}
	}
	
	# Validate OS Selection
	if (($OSComboBox).SelectedIndex -ne $null)
	{
		$WindowsVersion = (\[string\]($OSComboBox).SelectedItem).Trim("Windows ")
	}
	else
	{
		$ProgressListBox.ForeColor = "Red"
		$ProgressListBox.Items.Add("Error: Operating System Not Specified")
		$ValidationErrors++
	}
	
	# Validate OS Architecture Selection
	if (($ArchitectureComboxBox).SelectedItem -ne $null)
	{
		$Architecture = "x" + (\[string\]$ArchitectureComboxBox.SelectedItem).Trim(" bit")
	}
	else
	{
		$ProgressListBox.ForeColor = "Red"
		$ProgressListBox.Items.Add("Error: Operating System Architecture Not Specified")
		$ValidationErrors++
	}
	
	#$ProgressListBox.Items.Add("DEBUG: Validation Errors $ValidationErrors")
	
	# Validate MDT PowerShell Commandlets / Install 
	if ((($ImportInto) -eq ("MDT" -or "Both")) -and ($ValidationErrors -eq 0))
	{
		# Validate MDT PS Commandlets
		if ((Test-Path -Path $MDTPSCommandlets) -eq $true)
		{
			# Import MDT Module
			$ProgressListBox.Items.Add("Importing: MDT PowerShell Commandlets")
			Import-Module $MDTPSCommandlets
		}
		else
		{
			$ProgressListBox.ForeColor = "Red"
			$ProgressListBox.Items.Add("Error: MDT PowerShell Commandlets file not found at $MDTPSCommandlets")
			$ValidationErrors++
		}
	}
	
	If ($ValidationErrors -eq 0)
	{
		# Test Package Path
		$ProgressListBox.Items.Clear()
		$ProgressListBox.ForeColor = "Black"
		$ProgressListBox.Items.Add("======== Starting Download Processes ======== ")
		$ProgressListBox.Items.Add(" ")
		$ProgressListBox.Items.Add("Models selected: $($ProductListBox.SelectedItems)")
		$ProgressListBox.Items.Add("Operating System specified: Windows $($WindowsVersion)")
		$ProgressListBox.Items.Add("Operating System architecture specified: $($Architecture)")
		$ProgressListBox.Items.Add(" ")
		$ProgressListBox.Items.Add("Site Code specified: $($SiteCode)")
		$ProgressListBox.Items.Add("Respository Path specified: $($RepositoryPath)")
		$ProgressListBox.Items.Add("Package Path specified: $($PackagePath)")
		
		# Operating System Version
		$OperatingSystem = ("Windows " + $WindowsVersion)
		$TotalModelCount = $DellProducts.Count
		$RemainingModels = $TotalModelCount
		
		# Initialise Job Progress Bar
		$ProgressBar.Maximum = $TotalModelCount
		$ModelProgressOverlay.Maximum = $TotalModelCount
		
		
		if ($ImportInto -ne "SCCM")
		{
			# Import MDT Module
			$ProgressListBox.Items.Add("IMPORT: Importing MDT PowerShell Module")
			Import-Module "C:\\Program Files\\Microsoft Deployment Toolkit\\bin\\MicrosoftDeploymentToolkit.psd1"
		}
		
		foreach ($Model in $DellProducts)
		{
			$ProgressListBox.Items.Add(" ")
			$ProgressListBox.Items.Add("Starting download,extract and import process for Dell model $($Model)")
			
			# =================== DEFINE VARIABLES =====================
			
			# Directory used for driver and BIOS downloads
			$DriverRepositoryRoot = ($RepositoryPath.Trimend("\\") + "\\Dell\\")
			
			# Directory used by SCCM for driver packages
			If ($ImportInto -ne "MDT") { $DriverPackageRoot = ($PackagePath.Trimend("\\") + "\\Dell\\") }
			
			
			# =================== INITIATE DOWNLOADS ===================
			
			if (($ImportInto -eq "SCCM") -or ($ImportInto -eq "Both"))
			{
				if ($DownloadType -ne "Drivers")
				{
					# ================= BIOS Upgrade Download ==================
					
					$ProgressListBox.Items.Add("Retrieving BIOS Download URL For Dell Client Model: $($Model)")
					$ModelLink = (Invoke-WebRequest -Uri $DellDownloadList).Links | Where-Object { $\_.outerText -eq $Model }
					$ModelURL = (Split-Path $DellDownloadList -Parent) + "/" + ($ModelLink.href)
					
					# Correct slash direction issues
					$ModelURL = $ModelURL.Replace("\\", "/")
					$BIOSDownload = (Invoke-WebRequest -Uri $ModelURL -UseBasicParsing).Links | Where-Object { ($\_.outerHTML -like "\*BIOS\*") -and ($\_.outerHTML -like "\*WINDOWS\*") } | select -First 1
					$BIOSFile = $BIOSDownload.href | Split-Path -Leaf
										
					If ($BIOSDownload -ne $null)
					{
						$ProgressListBox.Items.Add("BIOS Download URL Found: $($BIOSDownload.href)")
						# Check for destination directory, create if required and download the BIOS upgrade file
						if ((Test-Path -Path ($DriverRepositoryRoot + $Model + "\\BIOS")) -eq $true)
						{
							if ((Test-Path -Path ($DriverRepositoryRoot + $Model + "\\BIOS\\" + $BIOSFile)) -eq $false)
							{
								$ProgressListBox.Items.Add("Downloading $($BIOSFile) BIOS update file")
								Start-BitsTransfer ($DellDownloadBase + $BIOSDownload.href) -Destination ($DriverRepositoryRoot + $Model + "\\BIOS\\" + $BIOSFile)
							}
							else
							{
								$ProgressListBox.Items.Add("Skipping $BIOSFile... File already downloaded...")
							}
						}
						else
						{
							$ProgressListBox.Items.Add("Creating $Model download folder")
							New-Item -Type dir -Path ($DriverRepositoryRoot + $Model + "\\BIOS")
							$ProgressListBox.Items.Add("Downloading $($BIOSFile) BIOS update file")
							Start-BitsTransfer ($DellDownloadBase + $BIOSDownload.href) -Destination ($DriverRepositoryRoot + $Model + "\\BIOS\\" + $BIOSFile)
						}
						$ProgressListBox.SelectedIndex = $ProgressListBox.Items.Count - 1;
						$ProgressListBox.SelectedIndex = -1;
						
						# ================= Create BIOS Update Package ==================
						
						$BIOSUpdatePackage = ("Dell" + " " + $Model + " " + "BIOS UPDATE")
						$BIOSUpdateRoot = ($DriverRepositoryRoot + $Model + "\\BIOS\\")
						
						Set-Location -Path ($SiteCode + ":")
						if ((Get-CMPackage -name $BIOSUpdatePackage) -eq $null)
						{
							$ProgressListBox.Items.Add("Creating BIOS Package")
							New-CMPackage -Name "$BIOSUpdatePackage" -Path $BIOSUpdateRoot -Description "Dell $Model BIOS Updates" -Manufacturer "Dell" -Language English
						}
						Set-Location -Path $env:SystemDrive
						$BIOSUpdateScript = ($BIOSUpdateRoot + "BIOSUpdate.ps1")
						$CurrentBIOSFile = Get-ChildItem -Path $BIOSUpdateRoot -Filter \*.exe -Recurse | Sort-Object $\_.LastWriteTime | select -First 1
						if ((Test-Path -Path $BIOSUpdateScript) -eq $False)
						{
							# Create BIOSUpdate.ps1 Deployment Script
							$ProgressListBox.Items.Add("Creating BIOS Update PowerShell Script")
							New-Item -Path ($BIOSUpdateRoot + "BIOSUpdate.ps1") -ItemType File
							$BIOSSwitches = " -noreboot -nopause "
							Add-Content -Path $BIOSUpdateScript ('$CurrentBIOSFile=' + '"' + $($CurrentBIOSFile.name) + '"')
							Add-Content -Path $BIOSUpdateScript ('$BIOSSwitches=' + '"' + $($BIOSSwitches) + '"')
							Add-Content -Path $BIOSUpdateScript ('Start-Process $CurrentBIOSFile -ArgumentList $BIOSSwitches')
						}
						else
						{
							# Check if older BIOS update exists and update BIOSUpdate deployment script
							$BIOSFileCount = (Get-ChildItem -Path $BIOSUpdateRoot -Filter \*.exe -Recurse).count
							if ($BIOSFileCount -gt 1)
							{
								$OldBIOSFiles = Get-ChildItem -Path $BIOSUpdateRoot -Filter \*.exe -Recurse | Where-Object { $\_.Name -ne $CurrentBIOSFile.name }
								
								foreach ($OldBIOS in $OldBIOSFiles)
								{
									(Get-Content -Path $BIOSUpdateScript) -replace $OldBIOS.name, $CurrentBIOSFile.name | Set-Content -Path $BIOSUpdateScript
								}
							}
						}
						$ProgressListBox.SelectedIndex = $ProgressListBox.Items.Count - 1;
						$ProgressListBox.SelectedIndex = -1;
						
						# =============== Refresh Distribution Points =================
						Set-Location -Path ($SiteCode + ":")
						Get-CMPackage -name $BIOSUpdatePackage | Update-CMDistributionPoint
						Set-Location -Path $env:SystemDrive
					}
					else
					{
						$ProgressListBox.Items.Add("BIOS Download Not Found")
					}
					
				}
				
				if ($DownloadType -ne "BIOS")
				{
					# Fix Up Model Lists For Dell Driver Pack Site
					$Model = $Model -replace "All In One", "AIO"
					$Model = $Model -replace "All-In-One", "AIO"
					$Model = $Model -replace "Rugged", " "
					$Model = $Model -replace "Rugged Extreme", " "
					$Model = ($Model).trim("2-in-1")
					$Model = ($Model).trim("XFR")
					$Model = ($Model).trim("ATG")
					$Model = ($Model).trim("e ST2E")
					$Model = ($Model).trim()
					
					# =============== SCCM Driver Cab Download =================
					
					$ProgressListBox.Items.Add(" ")
					$ProgressListBox.Items.Add("Retrieving SCCM Driver Pack Site For Model: $Model")
					$ModelLink = (Invoke-WebRequest -Uri $DellDriverListURL -UseBasicParsing).Links | Where-Object { ($\_.outerHTML -like "\*$Model W\*") -and ($\_.outerHTML -like "\*$OperatingSystem\*") } | select -First 1
					$ModelURL = $DellBaseURL + ($ModelLink.href)
					$ProgressListBox.Items.Add("URL Found: $ModelURL")
					$ProgressListBox.SelectedIndex = $ProgressListBox.Items.Count - 1;
					$ProgressListBox.SelectedIndex = -1;
					
					If ($ModelURL -ne $DellBaseURL)
					{
						$ModelURL = $ModelURL.Replace("\\", "/")
						$SCCMDriverDownload = (Invoke-WebRequest -Uri $ModelURL -UseBasicParsing).Links | Where-Object { $\_.href -like "\*.cab" }
						$SCCMDriverCab = $SCCMDriverDownload.href | Split-Path -Leaf
						$DriverSourceCab = ($DriverRepositoryRoot + $Model + "\\Driver Cab\\" + $SCCMDriverCab)
						$DriverPackageDir = ($DriverSourceCab | Split-Path -Leaf)
						$DriverPackageDir = $DriverPackageDir.Substring(0, $DriverPackageDir.length - 4)
						$DriverCabDest = $DriverPackageRoot + $DriverPackageDir
						$DriverRevision = ($DriverPackageDir).Split("-")\[2\]
						$DriverCategoryName = (('"' + 'Dell ' + $Model + '"') + "," + ("$DriverRevision"))
						$DriverExtractDest = ($DriverRepositoryRoot + $Model + "\\" + $DriverRevision)
						
						# Check for destination directory, create if required and download the driver cab
						if ((Test-Path -Path ($DriverRepositoryRoot + $Model + "\\Driver Cab\\" + $SCCMDriverCab)) -eq $false)
						{
							$ProgressListBox.Items.Add("Creating $Model download folder")
							if ((Test-Path -Path ($DriverRepositoryRoot + $Model + "\\Driver Cab")) -eq $false)
							{
								New-Item -Type dir -Path ($DriverRepositoryRoot + $Model + "\\Driver Cab")
							}
							$ProgressListBox.Items.Add("Downloading $($SCCMDriverCab) driver cab file")
							$ProgressListBox.Items.Add("Downloading from URL: $($SCCMDriverDownload.href)")
							$ProgressListBox.SelectedIndex = $ProgressListBox.Items.Count - 1;
							$ProgressListBox.SelectedIndex = -1;
							Start-BitsTransfer -DisplayName "$Model Driver Download" -Source ($SCCMDriverDownload.href) -Destination ($DriverRepositoryRoot + $Model + "\\Driver Cab\\" + $SCCMDriverCab) -RetryTimeout 90 -RetryInterval 180
						}
						else
						{
							$ProgressListBox.Items.Add("Skipping $SCCMDriverCab... Driver pack already downloaded...")
						}
						
						# =============== Create Driver Package + Import Drivers =================
						
						#$ProgressListBox.Items.Add("DEBUG Driver Package Location: $DriverCabDest")
						if ((Test-Path -Path $DriverCabDest) -eq $false)
						{
							New-Item -Type dir -Path $DriverExtractDest
							New-Item -Type dir -Path $DriverCabDest
							Set-Location -Path ($SiteCode + ":")
							$CMDDriverPackage = ("Dell " + $Model + " - " + $OperatingSystem + " " + $Architecture)
							$ProgressListBox.Items.Add("Creating driver package")
							$ProgressListBox.SelectedIndex = $ProgressListBox.Items.Count - 1;
							$ProgressListBox.SelectedIndex = -1;
							Set-Location -Path $env:SystemDrive
							$ProgressListBox.Items.Add("Expanding Driver CAB Sourece File: $DriverSourceCab")
							$ProgressListBox.Items.Add("Expanding Driver CAB Destination Directory: $DriverExtractDest")
							$ProgressListBox.SelectedIndex = $ProgressListBox.Items.Count - 1;
							$ProgressListBox.SelectedIndex = -1;
							Expand "$DriverSourceCab" -F:\* "$DriverExtractDest"
							$DriverINFFiles = Get-ChildItem -Path $DriverExtractDest -Recurse -Filter "\*.inf" | Where-Object { $\_.FullName -like "\*$Architecture\*" }
							Set-Location -Path ($SiteCode + ":")
							if (Get-CMCategory -CategoryType DriverCategories -name $DriverCategoryName)
							{
								$ProgressListBox.Items.Add("Category already exists")
								$DriverCategory = Get-CMCategory -CategoryType DriverCategories -name $DriverCategoryName
							}
							else
							{
								$ProgressListBox.Items.Add("Creating category")
								$DriverCategory = New-CMCategory -CategoryType DriverCategories -name $DriverCategoryName
							}
							$ProgressListBox.Items.Add("Creating Driver Package for Dell $Model")
							$ProgressListBox.SelectedIndex = $ProgressListBox.Items.Count - 1;
							$ProgressListBox.SelectedIndex = -1;
							New-CMDriverPackage -Name $CMDDriverPackage -path ($DriverPackageRoot + $DriverPackageDir + "\\" + $Architecture)
							Set-CMDriverPackage -Name $CMDDriverPackage -Version $DriverRevision
							$DriverPackage = Get-CMDriverPackage -Name $CMDDriverPackage
							foreach ($DriverINF in $DriverINFFiles)
							{
								$DriverInfo = Import-CMDriver -UncFileLocation ($DriverINF.FullName) -ImportDuplicateDriverOption AppendCategory -EnableAndAllowInstall $True -AdministrativeCategory $DriverCategory | Select-Object \*
								Add-CMDriverToDriverPackage -DriverID $DriverInfo.CI\_ID -DriverPackageName "$($CMDDriverPackage)" -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
							}
						}
						else
						{
							$ProgressListBox.Items.Add("Driver Package Already Exists.. Skipping")
						}
						Set-Location -Path $env:SystemDrive
					}
					else
					{
						$ProgressListBox.Items.Add("Operating system driver package download path not found.. Skipping $Model")
					}
				}
			}
			
			if (($ImportInto -eq "Both") -or ($ImportInto -eq "MDT"))
			{
				# Fix Up Model Lists For Dell Driver Pack Site
				$Model = $Model -replace "All In One", "AIO"
				$Model = $Model -replace "All-In-One", "AIO"
				$Model = $Model -replace "Rugged", " "
				$Model = $Model -replace "Rugged Extreme", " "
				$Model = ($Model).trim("2-in-1")
				$Model = ($Model).trim("XFR")
				$Model = ($Model).trim("ATG")
				$Model = ($Model).trim("e ST2E")
				$Model = ($Model).trim()
				
				# =================== MDT Driver Download =====================
				
				$ProgressListBox.Items.Add(" ")
				$ProgressListBox.Items.Add("==================== MDT Driver Download ====================")
				$ProgressListBox.Items.Add(" ")
				$ProgressListBox.Items.Add("Starting MDT Driver Download Process")
				$ProgressListBox.SelectedIndex = $ProgressListBox.Items.Count - 1;
				$ProgressListBox.SelectedIndex = -1;
				
				# =================== DEFINE VARIABLES =====================
				
				# Directory used for driver downloads
				$DriverRepositoryRoot = ($RepositoryPath.Trimend("\\") + "\\Dell\\")
				$ProgressListBox.Items.Add("MDT: Driver Package Base Location Set To $DriverRepositoryRoot")
				
				# Operating System Version
				$OperatingSystem = ("Windows " + $WindowsVersion)
				$ProgressListBox.SelectedIndex = $ProgressListBox.Items.Count - 1;
				$ProgressListBox.SelectedIndex = -1;
				
				# =============== MDT Driver Cab Download =================
				
				$ProgressListBox.Items.Add(" ")
				#$ProgressListBox.Items.Add("DEBUG: Driver Link URL - $DellDriverListURL")
				#$ProgressListBox.Items.Add("DEBUG: $Model")
				$ModelLink = (Invoke-WebRequest -Uri $DellDriverListURL -UseBasicParsing).Links | Where-Object { ($\_.outerHTML -like "\*$Model W\*") -and ($\_.outerHTML -like "\*$OperatingSystem\*") } | select -First 1
				#$ProgressListBox.Items.Add("DEBUG: Detecting Model Driver Link URL - $ModelLink")
				$ModelURL = $DellBaseURL + ($ModelLink.href)
				#$ProgressListBox.Items.Add("DEBUG: Detecting Driver Link URL - $ModelURL")
				$ProgressListBox.SelectedIndex = $ProgressListBox.Items.Count - 1;
				$ProgressListBox.SelectedIndex = -1;
				
				If ($ModelURL -ne $DellBaseURL)
				{
					
					# Correct slash direction issues
					$ModelURL = $ModelURL.Replace("\\", "/")
					$MDTDriverDownload = (Invoke-WebRequest -Uri $ModelURL -UseBasicParsing).Links | Where-Object { $\_.href -like "\*.cab" }
					$MDTDriverCab = $MDTDriverDownload.href | Split-Path -Leaf
					
					# Check for destination directory, create if required and download the driver cab
					if ((Test-Path -Path ($DriverRepositoryRoot + $Model + "\\Driver Cab\\" + $MDTDriverCab)) -eq $false)
					{
						if ((Test-Path -Path ($DriverRepositoryRoot + $Model + "\\Driver Cab\\")) -eq $false)
						{
							$ProgressListBox.Items.Add("Creating $Model Download Folder")
							New-Item -Type dir -Path ($DriverRepositoryRoot + $Model + "\\Driver Cab")
						}
						else
						{
							# Remove previous driver cab revisions
							Get-ChildItem -Path ($DriverRepositoryRoot + $Model + "\\Driver Cab\\") | Remove-Item
						}
						$ProgressListBox.Items.Add("Downloading $($MDTDriverCab) Driver Cab File")
						Start-BitsTransfer -Source ($MDTDriverDownload.href) -Destination ($DriverRepositoryRoot + $Model + "\\Driver Cab\\" + $MDTDriverCab)
					}
					else
					{
						$ProgressListBox.Items.Add("Skipping $MDTDriverCab... Driver pack already downloaded...")
					}
					
					# =============== MDT Driver Import ====================
					
					$ProgressListBox.Items.Add(" ")
					$ProgressListBox.Items.Add("==================== MDT Driver Import ====================")
					$ProgressListBox.Items.Add(" ")
					$ProgressListBox.Items.Add("Starting MDT Driver Import Process")
					$ProgressListBox.SelectedIndex = $ProgressListBox.Items.Count - 1;
					$ProgressListBox.SelectedIndex = -1;
					
					# Detect First MDT PSDrive
					$ProgressListBox.Items.Add("MDT: Detecting MDT PSDrive")
					If (!$PSDriveName) { $PSDriveName = (Get-MDTPersistentDrive)\[0\].name }
					
					# Detect First MDT Deployment Share
					$ProgressListBox.Items.Add("MDT: Detecting MDT Deployment Share")
					If (!$DeploymentShare) { $DeploymentShare = (Get-MDTPersistentDrive)\[0\].path }
					
					$MDTDriverPath = $PSDriveName + ':\\Out-of-Box Drivers'
					#$ProgressListBox.Items.Add("DEBUG: MDTDriverPath = $MDTDriverPath")
					$MDTSelectionProfilePath = $PSDriveName + ':\\Selection Profiles'
					#$ProgressListBox.Items.Add("DEBUG: MDTSelectionProfilePath = $MDTSelectionProfilePath")
					
					# Connect to Deployment Share
					$ProgressListBox.Items.Add("MDT: Connecting to MDT Share")
					If (!(Get-PSDrive -Name $PSDriveName -ErrorAction SilentlyContinue))
					{
						New-PSDrive -Name $PSDriveName -PSProvider MDTProvider -Root $DeploymentShare
					}
					
					$DSDriverPath = $PSDriveName + ':\\Out-of-Box Drivers'
					$DSSelectionProfilePath = $PSDriveName + ':\\Selection Profiles'
					
					# Connect to Deployment Share
					If ((Get-PSDrive -Name $PSDriveName -ErrorAction SilentlyContinue) -eq $false)
					{
						New-PSDrive -Name $PSDriveName -PSProvider MDTProvider -Root $DeploymentShare
					}
					
					# =============== MDT Driver Import ====================
					
					$Make = "Dell"
					$OperatingSystemDir = ($OperatingSystem + " " + $Architecture)
					$DriverSource = $DriverRepositoryRoot + $Model + '\\Driver Cab\\' + $MDTDriverCab
					#$ProgressListBox.Items.Add("DEBUG: SOURCE $DriverSource")
					#$ProgressListBox.Items.Add("DEBUG: REVISION $($($MDTDriverCab).Split("-")\[2\])")
					
					$DriverRevision = $($($MDTDriverCab).Split("-")\[2\])
					#$ProgressListBox.Items.Add("DEBUG: DRIVER REVISION $DriverRevision")
					if ((Test-Path $MDTDriverPath\\$OperatingSystemDir) -eq $false)
					{
						New-Item -path $MDTDriverPath -enable "True" -Name $OperatingSystemDir -ItemType "folder"
					}
					
					if ((Test-Path $MDTSelectionProfilePath"\\Drivers - "$OperatingSystemDir) -eq $false)
					{
						New-Item -path $MDTSelectionProfilePath -enable "True" -Name "Drivers - $OperatingSystemDir" -Definition "<SelectionProfile><Include path=\`"Out-of-Box Drivers\\$OS\`" /></SelectionProfile>" -ReadOnly "False" -Verbose
					}
					if ((Test-Path $MDTDriverPath\\$OperatingSystemDir\\$Make) -eq $false)
					{
						New-Item -path $MDTDriverPath\\$OperatingSystemDir -enable "True" -Name $Make -ItemType "folder"
					}
					if ((Test-Path $MDTDriverPath\\$OperatingSystemDir\\$Make\\$Model) -eq $false)
					{
						New-Item -path $MDTDriverPath\\$OperatingSystemDir\\$Make -enable "True" -Name $Model -ItemType "folder"
					}
					if ((Test-Path $MDTDriverPath\\$OperatingSystemDir\\$Make\\$Model\\$DriverRevision) -eq $false)
					{
						New-Item -path $MDTDriverPath\\$OperatingSystemDir\\$Make\\$Model -enable "True" -Name $DriverRevision -ItemType "folder"
						$ProgressListBox.Items.Add("MDT: Importing MDT driver pack for $Make $Model - Revision $DriverRevision")
						$ProgressListBox.Items.Add("MDT: MDT Driver Path = $MDTDriverPath\\$OperatingSystemDir\\$Make\\$Model\\$DriverRevision")
						Import-MDTDriver -path "$MDTDriverPath\\$OperatingSystemDir\\$Make\\$Model\\$DriverRevision" -SourcePath "$($DriverSource | Split-Path -Parent)"
					}
					else
					{
						$ProgressListBox.Items.Add("MDT driver pack already exists.. Skipping..")
					}
				}
			}
			$ProgressBar.Increment(1)
			$ModelProgressOverlay.Increment(1)
			$RemainingModels--
			$ProgressListBox.SelectedIndex = $ProgressListBox.Items.Count - 1;
			$ProgressListBox.SelectedIndex = -1;
		}
		$ProgressBar.Increment(1)
		$ModelProgressOverlay.Increment(1)
		$ProgressListBox.Items.Add(" ")
		$ProgressListBox.Items.Add("======== Finished Processing ======== ")
		$ProgressListBox.Items.Add(" ")
		$ProgressListBox.SelectedIndex = $ProgressListBox.Items.Count - 1;
		$ProgressListBox.SelectedIndex = -1;
	}
	
	#Output to Log
	$ProgressListBox.Items | Out-File -FilePath $LogFile -Append
}

$FindModelsButton\_Click = {
	
	# Determine SCCM or MDT Manual Import then find available models
	if ($MDTPathLabel.Text -like "\*.csv")
	{
		$ProgressListBox.Items.Add("Importing Model List: $($OpenMDTFileDialog.FileName) ")
		$Models = Import-Csv -Path $OpenMDTFileDialog.FileName
		$ProgressListBox.Items.Add("Models Found: $($Models.Model)")
		$ProgressListBox.Items.Add(" ")
		# Add model to ArrayList if not present
		if ($Models -ne $null)
		{
			foreach ($Model in $Models.Model)
			{
				if ($Model -notin $DellProducts)
				{
					$DellProducts.Add($Model) | Out-Null
					$ProductListBox.Items.Add($Model)
				}
			}
			$StartDownloadButton.Enabled = $true
		}
		else
		{
			$ProgressListBox.ForeColor = "Red"
			$ProgressListBox.Items.Add("Error: CSV File Not Formatted Correctly Or No Models Listed")
			$ProgressListBox.Items.Add("Error: Please check the contents of your CSV file. It should contain a single column with Model as the header.")
		}
	}
	else
	{
		$SiteServer = \[string\]$SiteServerInput.Text
		$ProgressListBox.ForeColor = "Black"
		$ProgressListBox.Items.Clear()
		$ProgressListBox.Items.Add("======== Validating SCCM Server Details ======== ")
		$ProgressListBox.Items.Add(" ")
		If ((Test-WSMan -ComputerName $SiteServer).wsmid -ne $null)
		{
			Clear-Host
			$ProgressListBox.Items.Add("Connected To Site Server: $SiteServer ")
			$ProgressListBox.Items.Add(" ")
			$ProgressListBox.ForeColor = "Black"
			$ProgressListBox.Items.Add("======== Checking SCCM Prerequisites ======== ")
			$ProgressListBox.Items.Add(" ")
			
			# Import SCCM PowerShell Module
			$ModuleName = (get-item $env:SMS\_ADMIN\_UI\_PATH).parent.FullName + "\\ConfigurationManager.psd1"
			If ($ModuleName -ne $null)
			{
				$ProgressListBox.Items.Add("Loading SCCM PowerShell Module")
				Import-Module $ModuleName
				$ProgressListBox.Items.Add(" ")
				$ProgressListBox.Items.Add("======== Connecting to SCCM Server ======== ")
				$ProgressListBox.Items.Add(" ")
				$ProgressListBox.Items.Add("Querying Site Code From $SiteServer")
				QuerySiteCode -SiteServer $SiteServer
				$SiteCode = $SiteCodeText.Text
				
				if ($SiteCode -ne $null)
				{
					# Enumerate through all models
					$Models = Get-WmiObject -ComputerName $SiteServer -Namespace "root\\SMS\\site\_$($SiteCode)" -Class SMS\_G\_System\_COMPUTER\_SYSTEM | Select-Object -Property Model | Where-Object { ($\_.Model -like "\*Optiplex\*") -or ($\_.Model -like "\*Latitude\*") -or ($\_.Model -like "\*Precision\*") }
					$ProgressListBox.Items.Add(" ")
					# Add model to ArrayList if not present
					if ($Models -ne $null)
					{
						foreach ($Model in $Models)
						{
							if ($Model.Model -notin $DellProducts)
							{
								$DellProducts.Add($Model.Model) | Out-Null
								$ProductListBox.Items.Add($Model.Model)
							}
						}
						$ProgressListBox.Items.Add("Models Found: $(($DellProducts).count)")
						$ProgressListBox.Items.Add(" ")
						$StartDownloadButton.Enabled = $true
					}
					else
					{
						$ProgressListBox.ForeColor = "Red"
						$ProgressListBox.Items.Add("Error: No Dell Client Models Found. Please check the Site Server name and ensure you have sufficient rights.")
					}
				}
			}
			else
			{
				$ProgressListBox.ForeColor = "Red"
				$ProgressListBox.Items.Add("Error: SCCM PowerShell Module Not Found")
			}
		}
		else
		{
			$ProgressListBox.ForeColor = "Red"
			$ProgressListBox.Items.Add("Error: SCCM Server Specified Not Found - $($SiteServerInput.Text)")
		}
		
	}
	
	#Output to Log
	$ProgressListBox.Items | Out-File -FilePath $LogFile -Append
}

$MDTBrowseButton\_Click = {
	
	$ProductListBox.Items.Clear()
	$OpenMDTFileDialog.Filter = "All CSV Files (\*.CSV) | \*.CSV"
	$OpenMDTFileDialog.ShowDialog()
	$MDTPathLabel.Text = $OpenMDTFileDialog.FileName
	If ($MDTPathLabel.Text -gt $null)
	{
		$FindModelsButton.Enabled = $true
		$PlatformComboBox.Text = "MDT"
		$PlatformComboBox.Enabled = $false
		$DownloadComboBox.Text = "Drivers"
		$DownloadComboBox.Enabled = $false
		$PackagePathTextBox.Enabled = $false
		$SiteServerInput.Enabled = $false
		$StartDownloadButton.Enabled = $true
	}
}


$PlatformComboBox\_SelectedValueChanged = {
	
	If (($PlatformComboBox.SelectedItem) -eq "MDT")
	{
		$DownloadComboBox.Text = "Drivers"
		$DownloadComboBox.Enabled = $false
		$PackagePathTextBox.Enabled = $false
	}
	If (($PlatformComboBox.SelectedItem) -ne "MDT")
	{
		$DownloadComboBox.Enabled = $true
		$PackagePathTextBox.Enabled = $true
	}
}

$ClearSelectionButton\_Click = {
	#Reset's Windows Form
	$ProgressListBox.ForeColor = "Black"
	$ProductListBox.Items.Clear()
	$ProgressListBox.Items.Clear()
	$SiteServerInput.Text = $null
	$SiteServerInput.Enabled = $true
	$SiteCodeText = $null
	$PlatformComboBox.SelectedItem = $null
	$PlatformComboBox.Enabled = $true
	$DownloadComboBox.SelectedItem = $null
	$DownloadComboBox.Enabled = $true
	$OSComboBox.SelectedItem = $null
	$OSComboBox.Enabled = $true
	$ArchitectureComboxBox.SelectedItem = $null
	$ArchitectureComboxBox.Enabled = $true
	$RepositoryTextBox.Text = $null
	$PackagePathTextBox.Text = $null
	$PackagePathTextBox.Enabled = $true
	$StartDownloadButton.Enabled = $false
	$MDTPathLabel.Text = $null
	
}

$AddToListlButton\_Click={
	$ProductListBox.Items.Add($DellModelListComboBox.Text)
}

$FindDellModelsButton\_Click={
	
	# Gets a list of Dell Optiplex, Latitude and Precision Workstation Models to select manually
	$ProgressListBox.Items.Add(" ")
	$ProgressListBox.Items.Add("======== Downloading Dell Model List ======== ")
	$ProgressListBox.Items.Add(" ")
	$ProgressListBox.Items.Add("Querying URL: $DellDownloadList")
	$ProgressListBox.Items.Add(" ")
	$DellModelList = (Invoke-WebRequest -Uri $DellDownloadList).links | Where-Object { ($\_.innerText -like "Latitude \*") -or ($\_.innerText -like "Optiplex \*") -or ($\_.innerText -like "Precision \*") -and ($\_.innerText -notlike "Precision Work\*") -and ($\_.innerText -notlike "Precision Mobile\*") } | Select-Object innerText
	foreach ($DellModel in $($DellModelList).innerText)
	{
	
		# Add Model to List
		$DellModelListComboBox.Items.Add($DellModel)
	}
	if (($DellModelList).count -gt "0")
	{
		$ProgressListBox.Items.Add("Returned $(($DellModelList).count) Models ")
		$ProgressListBox.Items.Add(" ")
	}
	$DellModelListComboBox.Text = ($DellModelList.innerText | Select -First 1)
	$DellModelListComboBox.Enabled = $true
	$AddToListlButton.Enabled = $true
	
	#Output to Log
	$ProgressListBox.Items | Out-File -FilePath $LogFile -Append
}



	# --End User Generated Script--
#----------------------------------------------
#region Generated Events
#----------------------------------------------

$Form\_StateCorrection\_Load=
{
	#Correct the initial state of the form to prevent the .Net maximized form issue
	$MainForm.WindowState = $InitialFormWindowState
}

$Form\_StoreValues\_Closing=
{
	#Store the control values
	$script:MainForm\_SiteCodeText = $SiteCodeText.Text
	$script:MainForm\_SiteServerInput = $SiteServerInput.Text
	$script:MainForm\_DellModelListComboBox = $DellModelListComboBox.Text
	$script:MainForm\_DellModelListComboBox\_SelectedItem = $DellModelListComboBox.SelectedItem
	$script:MainForm\_ProgressListBox = $ProgressListBox.SelectedItems
	$script:MainForm\_ProductListBox = $ProductListBox.SelectedItems
	$script:MainForm\_ArchitectureComboxBox = $ArchitectureComboxBox.Text
	$script:MainForm\_ArchitectureComboxBox\_SelectedItem = $ArchitectureComboxBox.SelectedItem
	$script:MainForm\_DownloadComboBox = $DownloadComboBox.Text
	$script:MainForm\_DownloadComboBox\_SelectedItem = $DownloadComboBox.SelectedItem
	$script:MainForm\_PlatformComboBox = $PlatformComboBox.Text
	$script:MainForm\_PlatformComboBox\_SelectedItem = $PlatformComboBox.SelectedItem
	$script:MainForm\_PackagePathTextBox = $PackagePathTextBox.Text
	$script:MainForm\_RepositoryTextBox = $RepositoryTextBox.Text
	$script:MainForm\_OSComboBox = $OSComboBox.Text
	$script:MainForm\_OSComboBox\_SelectedItem = $OSComboBox.SelectedItem
}


$Form\_Cleanup\_FormClosed=
{
	#Remove all event handlers from the controls
	try
	{
		$FindModelsButton.remove\_Click($FindModelsButton\_Click)
		$FindDellModelsButton.remove\_Click($FindDellModelsButton\_Click)
		$AddToListlButton.remove\_Click($AddToListlButton\_Click)
		$MDTBrowseButton.remove\_Click($MDTBrowseButton\_Click)
		$ClearSelectionButton.remove\_Click($ClearSelectionButton\_Click)
		$StartDownloadButton.remove\_Click($StartDownloadButton\_Click)
		$PlatformComboBox.remove\_SelectedValueChanged($PlatformComboBox\_SelectedValueChanged)
		$MainForm.remove\_Load($MainForm\_Load)
		$MainForm.remove\_Load($Form\_StateCorrection\_Load)
		$MainForm.remove\_Closing($Form\_StoreValues\_Closing)
		$MainForm.remove\_FormClosed($Form\_Cleanup\_FormClosed)
	}
	catch { Out-Null <# Prevent PSScriptAnalyzer warning #> }
}
#endregion Generated Events

#----------------------------------------------
#region Generated Form Code
#----------------------------------------------
$MainForm.SuspendLayout()
$SCCMDellTabControl.SuspendLayout()
$SCCMTabPage1.SuspendLayout()
$SCCMTabPage2.SuspendLayout()
$SCCMTabPage3.SuspendLayout()
$DownloadGroupBox.SuspendLayout()
#
# MainForm
#
$MainForm.Controls.Add($SCCMDellTabControl)
$MainForm.Controls.Add($labelPleaseNoteThisToolIs)
$MainForm.Controls.Add($ClearSelectionButton)
$MainForm.Controls.Add($ModelProgressOverlay)
$MainForm.Controls.Add($ProgressBar)
$MainForm.Controls.Add($ProgressListBox)
$MainForm.Controls.Add($AboutToolLabel)
$MainForm.Controls.Add($AutomationLabel)
$MainForm.Controls.Add($picturebox1)
$MainForm.Controls.Add($labelDeployEverythingcom)
$MainForm.Controls.Add($ProductListBox)
$MainForm.Controls.Add($StartDownloadButton)
$MainForm.Controls.Add($DownloadGroupBox)
$MainForm.Controls.Add($ModelListBox)
$MainForm.Controls.Add($LoggingLabel)
$MainForm.Controls.Add($ModelProgressLabel)
$MainForm.AutoScaleDimensions = '9, 17'
$MainForm.AutoScaleMode = 'Font'
$MainForm.BackColor = 'White'
$MainForm.ClientSize = '981, 653'
$MainForm.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$MainForm.FormBorderStyle = 'FixedSingle'
$MainForm.Margin = '5, 4, 5, 4'
$MainForm.MaximizeBox = $False
$MainForm.MinimizeBox = $False
$MainForm.Name = 'MainForm'
$MainForm.SizeGripStyle = 'Hide'
$MainForm.StartPosition = 'CenterScreen'
$MainForm.Text = 'DeployEverything.com - Dell Driver Download Automation Tool v1.3'
$MainForm.add\_Load($MainForm\_Load)
#
# SCCMDellTabControl
#
$SCCMDellTabControl.Controls.Add($SCCMTabPage1)
$SCCMDellTabControl.Controls.Add($SCCMTabPage2)
$SCCMDellTabControl.Controls.Add($SCCMTabPage3)
$SCCMDellTabControl.Location = '28, 101'
$SCCMDellTabControl.Margin = '4, 3, 4, 3'
$SCCMDellTabControl.Name = 'SCCMDellTabControl'
$SCCMDellTabControl.SelectedIndex = 0
$SCCMDellTabControl.Size = '934, 91'
$SCCMDellTabControl.TabIndex = 0
#
# SCCMTabPage1
#
$SCCMTabPage1.Controls.Add($SiteCodeText)
$SCCMTabPage1.Controls.Add($SiteServerInput)
$SCCMTabPage1.Controls.Add($FindModelsButton)
$SCCMTabPage1.Controls.Add($SiteCodeLabel)
$SCCMTabPage1.Controls.Add($SiteServerLabel)
$SCCMTabPage1.BackColor = 'WhiteSmoke'
$SCCMTabPage1.ForeColor = 'SteelBlue'
$SCCMTabPage1.Location = '4, 26'
$SCCMTabPage1.Margin = '4, 3, 4, 3'
$SCCMTabPage1.Name = 'SCCMTabPage1'
$SCCMTabPage1.Padding = '4, 3, 4, 3'
$SCCMTabPage1.Size = '926, 61'
$SCCMTabPage1.TabIndex = 0
$SCCMTabPage1.Text = 'SCCM Site Details'
#
# SiteCodeText
#
$SiteCodeText.CharacterCasing = 'Upper'
$SiteCodeText.Enabled = $False
$SiteCodeText.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$SiteCodeText.ForeColor = 'SteelBlue'
$SiteCodeText.Location = '357, 24'
$SiteCodeText.Margin = '4, 3, 4, 3'
$SiteCodeText.Name = 'SiteCodeText'
$SiteCodeText.Size = '64, 23'
$SiteCodeText.TabIndex = 10
#
# SiteServerInput
#
$SiteServerInput.CharacterCasing = 'Upper'
$SiteServerInput.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$SiteServerInput.ForeColor = 'SteelBlue'
$SiteServerInput.Location = '105, 24'
$SiteServerInput.Margin = '4, 3, 4, 3'
$SiteServerInput.Name = 'SiteServerInput'
$SiteServerInput.Size = '150, 23'
$SiteServerInput.TabIndex = 8
#
# FindModelsButton
#
$FindModelsButton.BackColor = 'SteelBlue'
$FindModelsButton.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$FindModelsButton.ForeColor = 'White'
$FindModelsButton.Location = '453, 24'
$FindModelsButton.Margin = '4, 3, 4, 3'
$FindModelsButton.Name = 'FindModelsButton'
$FindModelsButton.Size = '157, 23'
$FindModelsButton.TabIndex = 5
$FindModelsButton.Text = 'Connect To SCCM'
$FindModelsButton.UseVisualStyleBackColor = $False
$FindModelsButton.add\_Click($FindModelsButton\_Click)
#
# SiteCodeLabel
#
$SiteCodeLabel.AutoSize = $True
$SiteCodeLabel.BackColor = 'WhiteSmoke'
$SiteCodeLabel.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$SiteCodeLabel.Location = '271, 27'
$SiteCodeLabel.Margin = '4, 0, 4, 0'
$SiteCodeLabel.Name = 'SiteCodeLabel'
$SiteCodeLabel.Size = '78, 17'
$SiteCodeLabel.TabIndex = 11
$SiteCodeLabel.Text = 'Site Code'
#
# SiteServerLabel
#
$SiteServerLabel.AutoSize = $True
$SiteServerLabel.BackColor = 'WhiteSmoke'
$SiteServerLabel.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$SiteServerLabel.Location = '8, 27'
$SiteServerLabel.Margin = '4, 0, 4, 0'
$SiteServerLabel.Name = 'SiteServerLabel'
$SiteServerLabel.Size = '89, 17'
$SiteServerLabel.TabIndex = 9
$SiteServerLabel.Text = 'Site Server'
#
# SCCMTabPage2
#
$SCCMTabPage2.Controls.Add($FindDellModelsButton)
$SCCMTabPage2.Controls.Add($labelAvailableModels)
$SCCMTabPage2.Controls.Add($AddToListlButton)
$SCCMTabPage2.Controls.Add($DellModelListComboBox)
$SCCMTabPage2.BackColor = 'WhiteSmoke'
$SCCMTabPage2.ForeColor = 'SteelBlue'
$SCCMTabPage2.Location = '4, 26'
$SCCMTabPage2.Margin = '4, 3, 4, 3'
$SCCMTabPage2.Name = 'SCCMTabPage2'
$SCCMTabPage2.Padding = '4, 3, 4, 3'
$SCCMTabPage2.Size = '926, 61'
$SCCMTabPage2.TabIndex = 1
$SCCMTabPage2.Text = 'Full Dell Product List'
#
# FindDellModelsButton
#
$FindDellModelsButton.BackColor = 'SteelBlue'
$FindDellModelsButton.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$FindDellModelsButton.ForeColor = 'White'
$FindDellModelsButton.Location = '358, 23'
$FindDellModelsButton.Margin = '4, 3, 4, 3'
$FindDellModelsButton.Name = 'FindDellModelsButton'
$FindDellModelsButton.Size = '112, 23'
$FindDellModelsButton.TabIndex = 11
$FindDellModelsButton.Text = 'Find Models'
$FindDellModelsButton.UseVisualStyleBackColor = $False
$FindDellModelsButton.add\_Click($FindDellModelsButton\_Click)
#
# labelAvailableModels
#
$labelAvailableModels.AutoSize = $True
$labelAvailableModels.BackColor = 'WhiteSmoke'
$labelAvailableModels.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$labelAvailableModels.Location = '8, 26'
$labelAvailableModels.Margin = '4, 0, 4, 0'
$labelAvailableModels.Name = 'labelAvailableModels'
$labelAvailableModels.Size = '135, 17'
$labelAvailableModels.TabIndex = 10
$labelAvailableModels.Text = 'Available Models:'
#
# AddToListlButton
#
$AddToListlButton.BackColor = 'SteelBlue'
$AddToListlButton.Enabled = $False
$AddToListlButton.ForeColor = 'White'
$AddToListlButton.Location = '478, 23'
$AddToListlButton.Margin = '4, 3, 4, 3'
$AddToListlButton.Name = 'AddToListlButton'
$AddToListlButton.Size = '112, 23'
$AddToListlButton.TabIndex = 1
$AddToListlButton.Text = 'Add To List'
$AddToListlButton.UseVisualStyleBackColor = $False
$AddToListlButton.add\_Click($AddToListlButton\_Click)
#
# DellModelListComboBox
#
$DellModelListComboBox.Enabled = $False
$DellModelListComboBox.FormattingEnabled = $True
$DellModelListComboBox.Location = '145, 23'
$DellModelListComboBox.Margin = '4, 3, 4, 3'
$DellModelListComboBox.Name = 'DellModelListComboBox'
$DellModelListComboBox.Size = '205, 25'
$DellModelListComboBox.TabIndex = 0
#
# SCCMTabPage3
#
$SCCMTabPage3.Controls.Add($MDTPathLabel)
$SCCMTabPage3.Controls.Add($MDTBrowseButton)
$SCCMTabPage3.BackColor = 'WhiteSmoke'
$SCCMTabPage3.ForeColor = 'SteelBlue'
$SCCMTabPage3.Location = '4, 26'
$SCCMTabPage3.Name = 'SCCMTabPage3'
$SCCMTabPage3.Size = '926, 61'
$SCCMTabPage3.TabIndex = 2
$SCCMTabPage3.Text = 'MDT Manual CSV Import'
#
# MDTPathLabel
#
$MDTPathLabel.AutoSize = $True
$MDTPathLabel.Location = '134, 28'
$MDTPathLabel.Margin = '4, 0, 4, 0'
$MDTPathLabel.Name = 'MDTPathLabel'
$MDTPathLabel.RightToLeft = 'No'
$MDTPathLabel.Size = '166, 17'
$MDTPathLabel.TabIndex = 3
$MDTPathLabel.Text = 'No Filename Selected'
#
# MDTBrowseButton
#
$MDTBrowseButton.BackColor = 'SteelBlue'
$MDTBrowseButton.ForeColor = 'White'
$MDTBrowseButton.Location = '28, 23'
$MDTBrowseButton.Margin = '4, 3, 4, 3'
$MDTBrowseButton.Name = 'MDTBrowseButton'
$MDTBrowseButton.Size = '88, 23'
$MDTBrowseButton.TabIndex = 2
$MDTBrowseButton.Text = 'Browse'
$MDTBrowseButton.UseVisualStyleBackColor = $False
$MDTBrowseButton.add\_Click($MDTBrowseButton\_Click)
#
# labelPleaseNoteThisToolIs
#
$labelPleaseNoteThisToolIs.AutoSize = $True
$labelPleaseNoteThisToolIs.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$labelPleaseNoteThisToolIs.Location = '28, 626'
$labelPleaseNoteThisToolIs.Margin = '4, 0, 4, 0'
$labelPleaseNoteThisToolIs.Name = 'labelPleaseNoteThisToolIs'
$labelPleaseNoteThisToolIs.Size = '389, 17'
$labelPleaseNoteThisToolIs.TabIndex = 36
$labelPleaseNoteThisToolIs.Text = 'Please Note: This tool is not an official Dell Product '
#
# ClearSelectionButton
#
$ClearSelectionButton.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$ClearSelectionButton.Location = '28, 369'
$ClearSelectionButton.Margin = '4, 3, 4, 3'
$ClearSelectionButton.Name = 'ClearSelectionButton'
$ClearSelectionButton.Size = '202, 23'
$ClearSelectionButton.TabIndex = 35
$ClearSelectionButton.Text = 'Clear Selection'
$ClearSelectionButton.UseVisualStyleBackColor = $True
$ClearSelectionButton.add\_Click($ClearSelectionButton\_Click)
#
# ModelProgressOverlay
#
$ModelProgressOverlay.Location = '28, 594'
$ModelProgressOverlay.Margin = '4, 3, 4, 3'
$ModelProgressOverlay.Name = 'ModelProgressOverlay'
$ModelProgressOverlay.Size = '934, 23'
$ModelProgressOverlay.TabIndex = 30
#
# ProgressBar
#
$ProgressBar.Location = '28, 594'
$ProgressBar.Margin = '4, 3, 4, 3'
$ProgressBar.Name = 'ProgressBar'
$ProgressBar.Size = '934, 23'
$ProgressBar.Style = 'Continuous'
$ProgressBar.TabIndex = 28
#
# ProgressListBox
#
$ProgressListBox.BackColor = 'WhiteSmoke'
$ProgressListBox.FormattingEnabled = $True
$ProgressListBox.ItemHeight = 17
$ProgressListBox.Location = '28, 422'
$ProgressListBox.Margin = '4, 3, 4, 3'
$ProgressListBox.Name = 'ProgressListBox'
$ProgressListBox.ScrollAlwaysVisible = $True
$ProgressListBox.Size = '934, 140'
$ProgressListBox.TabIndex = 27
#
# AboutToolLabel
#
$AboutToolLabel.AutoSize = $True
$AboutToolLabel.Font = 'Microsoft Sans Serif, 9pt'
$AboutToolLabel.Location = '165, 61'
$AboutToolLabel.Margin = '4, 0, 4, 0'
$AboutToolLabel.Name = 'AboutToolLabel'
$AboutToolLabel.Size = '746, 18'
$AboutToolLabel.TabIndex = 26
$AboutToolLabel.Text = ' Automates the process of downloading, extracting and importing drivers and BIOS updates into SCCM and MDT'
#
# AutomationLabel
#
$AutomationLabel.AutoSize = $True
$AutomationLabel.Font = 'Microsoft Sans Serif, 18pt, style=Bold'
$AutomationLabel.ForeColor = 'SteelBlue'
$AutomationLabel.Location = '165, 25'
$AutomationLabel.Margin = '4, 0, 4, 0'
$AutomationLabel.Name = 'AutomationLabel'
$AutomationLabel.Size = '686, 36'
$AutomationLabel.TabIndex = 25
$AutomationLabel.Text = 'DeployEverything - Dell Driver Automation Tool'
#
# picturebox1
#
#region Binary Data
$picturebox1.Image = \[System.Convert\]::FromBase64String(' /9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAICAgICAQICAgIDAgIDAwYEAwMDAwcFBQQGCAcJCAgH CAgJCg0LCQoMCggICw8LDA0ODg8OCQsQERAOEQ0ODg7/2wBDAQIDAwMDAwcEBAcOCQgJDg4ODg4O Dg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg7/wAARCABQAFADASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD9efip 8XG8ParJ4d0GVBqSqPtVycHycjIUD+9j8q+LfHPx58HeEr5W8d+PLfT7yUb1iurlpZiPXy1DNj3x ivJ/ix8VLvRPh3438cMRPfxxy3Maucgyu2Ez7bnXj0r8V9X1bUte8T3msaxey6jqd3KZbm4nbc8j Huf8OgHFAH7d/wDDWvwL/wCilWv/AIB3f/xqj/hrX4F/9FKtf/AO7/8AjVfhoFLPxVlLfOOKAP3D /wCGtPgZ/wBFJtf/AACu/wD41Sf8NafAz/opVr/4B3f/AMar8RRa8UG2+XpQB+3X/DWvwL/6KVa/ +Ad3/wDGqP8AhrX4F/8ARSrX/wAA7v8A+NV+HrwYFVipUHIoA/oQ8DfHnwd4tvmbwJ48t9QvIhva K1uWimA9fLYK2PfGK+0vhX8XG8Q6rH4d16VDqTKfstyMDzsDJUj+9j86/ks0nV9S0HxFZaxo97Lp 2qWkoltrmB9rxsO4/kR0I4NftR8Jfirda78OvBPjlSIL+RIriRUOAJY32vj2LI3HpQB8xfGjWzdf syeMbffnfBGMZ/6bx1+cqqWcCvpDWfH0Hir9nPW0MwXUBbxrcwk8hhKmSPY4rE/Z9+Bnib4+fHm0 8IaARZWaKJ9W1ORMx2UAOCx9WPRV7n6GgDxqGAswAGTXXt4S8Q22lC+udB1G3ssZ+0S2Uix49dxG K/bvUPFf7Jv7C+kWeg6P4Zj8XfE5YFeR1ijn1Ikjh5JmGLcHqFXHHY9a9r/ZZ/a+m/aQ8feMNHl8 GR+GLXSLGK4jc3nnNMJHKbWGABjFOxNz+c9bMlRgUNZkJ0r6i+JV/p/hz/go18R9Ym0W31bT7Lxt qJ/s6RAI2UXEigAYxxwQMY4Fehn9oPwcoyfhuD+MH/xFCSBt9j4LmtSARismaDAORX6BSftG+CIx 8/w1B/78f/E1ny/tM+AUzu+GZ/KD/wCJp2XcV32Pz8ZSrV+i3wS1s2v7MXhG3342RS8Z/wCm8lfP nxn+MPhX4h+CbHS9E8ER6Fdw3Qla9ZY94XBGwbADg55z6VDoXj6Dwp+zjo0YmB1AwyrbQg8ljK/J HoM5pFLU+ZopW86QBiN3BwevzCv2m/YynsPhH/wTB8dfFOO2SbWJkvL5iw5kW2jIhjz1wXBz9a/E q2kze4/z1Ffrr+yL4k0zx1+wv4w+EV/cCK4VLm3dc/MILlCFcD/ZbP4047ilsfnjqWs6t4n8aap4 h16+k1LWtRunub26mbLSyOck/wCA6AYFfp3/AME0rgWnxf8AiYwON2jWw/8AIzV+Z/iDwzrPgv4g 6n4a1+1a01OxmMcqkcMOzqe6kcg+hr7W/Ym+J3g/4c/FLxhJ4u1628PwajpkUdtPdttjZkkLFS3Q HB4z1pLcHseP/GRBN+2H8VZOu7xfqR/8mpK4rTvD0+sSzRwTW1qsShnluZdiDPQd+fwrX8e6/ZeI Pj34317TZTPp2o+IL26tZCpXfHJcO6Ng8jKkHn1rlGvpYo2MT7M9RtBB/A1z1vbeyfsrc3S+xyYr 619Wl9Vt7S2nNe1/O2ptXHw41CQYXWdGP/b6f/ia5PXPh3qunaBdag+o6XcxQJueOC83OR7AgZpL jW7+MZWVP+/Kf4Vzep6/qVzp8ttLMhhcYYLEqkj6gV4sHnXOudQt11ex8hRXGHtY+1dHlur2Ur26 213scHdKM1gSSsJUBJIXIGT0+Y1v3LZNclcSYvMe/wDU19CfeFOxkzqSj/PWvZfh34/1/wCHHxJs vEvhy58m7hO2WJs+XcRn7yOPQ/pXh2mvu1mMe9dqpKuKAP1GT4l/AL4/eHLODx2sHhzxJHHtWS7n FvLEe4jnPysuezflT7b9mX4STnzbf4izLC3Kbbm3cY+uea/MaGbB61pRvCcExoT7qKq/cjltsz9Q Iv2YPhSQP+Lkzg/9dbf/ABqx/wAMsfCh1wfidP8A9/Lf/wCKr8xRJBgfuU/75FDSQFP9TH/3yKLr sOz7n6Zy/sl/CSQc/FC4H/bS3/8Aiqyp/wBkD4QODn4o3X/fy3/+Kr805mhK58pP++RWTMYyD8i/ 98ii67BZ9z6z/aC+BHgD4XfDaw1nwz4+Ou6jPeCE6fM0RdkIJLrsOcDAzn1r4WvJMaiw9/611BAy SFA+gri9RfGsSD3/AK0mNGt4r8P6j8Pvjr4l8I6zC8GpaDrFxp93G4IIeGVoz+B25B9K20lSWNZI 2DIRkEV+6f8AwUK/4J7a58WfG178a/gnZxXPjWaIf8JB4f3rGdTKLtWaJjgebtABBI3YHOev4D+J PC/jz4e+I5tG8XeG9Z8I6nExWS01bT5LZwR7OBke44NIZ1QchsirCXBGK8t/tm//AOfhqP7Zv/8A n4agD1v7XxSG6O2vJv7a1D/n4aj+2tQ/5+GoA9RefIquzlhzXmv9s3//AD8NR/bN/wD8/DUAeiSS pFA0kjBVXkk1ieE/D+o/EH46eGvCOjQvPqevaxb6faRoMkvNKsY/Absk+lVvDfhfx58QvEUGjeEf DWs+LtSlYLHaaTp8ly5J9kBwPc8Cv34/4J6/8E9tc+E3jay+Nfxss4rbxrDEf+Ef8P71kOmF12tN KwyPN2kgAE7cnnPQA//Z')
#endregion
$picturebox1.Location = '77, 12'
$picturebox1.Margin = '4, 3, 4, 3'
$picturebox1.Name = 'picturebox1'
$picturebox1.Size = '70, 70'
$picturebox1.SizeMode = 'StretchImage'
$picturebox1.TabIndex = 24
$picturebox1.TabStop = $False
#
# labelDeployEverythingcom
#
$labelDeployEverythingcom.AutoSize = $True
$labelDeployEverythingcom.Font = 'Microsoft Sans Serif, 10pt, style=Bold'
$labelDeployEverythingcom.ForeColor = 'DarkGreen'
$labelDeployEverythingcom.Location = '767, 626'
$labelDeployEverythingcom.Margin = '4, 0, 4, 0'
$labelDeployEverythingcom.Name = 'labelDeployEverythingcom'
$labelDeployEverythingcom.Size = '195, 20'
$labelDeployEverythingcom.TabIndex = 15
$labelDeployEverythingcom.Text = 'DeployEverything.com'
#
# ProductListBox
#
$ProductListBox.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$ProductListBox.ForeColor = 'SteelBlue'
$ProductListBox.FormattingEnabled = $True
$ProductListBox.ItemHeight = 17
$ProductListBox.Location = '28, 214'
$ProductListBox.Margin = '4, 3, 4, 3'
$ProductListBox.Name = 'ProductListBox'
$ProductListBox.SelectionMode = 'MultiExtended'
$ProductListBox.Size = '202, 140'
$ProductListBox.Sorted = $True
$ProductListBox.TabIndex = 3
#
# StartDownloadButton
#
$StartDownloadButton.Anchor = 'None'
$StartDownloadButton.BackColor = 'SteelBlue'
$StartDownloadButton.Enabled = $False
$StartDownloadButton.FlatAppearance.BorderSize = 0
$StartDownloadButton.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$StartDownloadButton.ForeColor = 'White'
$StartDownloadButton.Location = '603, 369'
$StartDownloadButton.Margin = '4, 3, 4, 3'
$StartDownloadButton.Name = 'StartDownloadButton'
$StartDownloadButton.Size = '359, 23'
$StartDownloadButton.TabIndex = 0
$StartDownloadButton.Text = 'Start Download and Import Process'
$StartDownloadButton.UseVisualStyleBackColor = $False
$StartDownloadButton.add\_Click($StartDownloadButton\_Click)
#
# DownloadGroupBox
#
$DownloadGroupBox.Controls.Add($ArchitectureComboxBox)
$DownloadGroupBox.Controls.Add($DownloadComboBox)
$DownloadGroupBox.Controls.Add($PlatformComboBox)
$DownloadGroupBox.Controls.Add($PackagePathTextBox)
$DownloadGroupBox.Controls.Add($RepositoryTextBox)
$DownloadGroupBox.Controls.Add($OSComboBox)
$DownloadGroupBox.Controls.Add($PackagePathLabel)
$DownloadGroupBox.Controls.Add($RepositoryLabel)
$DownloadGroupBox.Controls.Add($ArchitectureCheckBox)
$DownloadGroupBox.Controls.Add($lSelectDeployLabel)
$DownloadGroupBox.Controls.Add($OperatingSysLabel)
$DownloadGroupBox.Controls.Add($labelDownloadType)
$DownloadGroupBox.BackColor = 'WhiteSmoke'
$DownloadGroupBox.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$DownloadGroupBox.ForeColor = 'SteelBlue'
$DownloadGroupBox.Location = '255, 198'
$DownloadGroupBox.Margin = '4, 3, 4, 3'
$DownloadGroupBox.Name = 'DownloadGroupBox'
$DownloadGroupBox.Padding = '4, 3, 4, 3'
$DownloadGroupBox.Size = '707, 165'
$DownloadGroupBox.TabIndex = 21
$DownloadGroupBox.TabStop = $False
$DownloadGroupBox.Text = 'Download Selection'
#
# ArchitectureComboxBox
#
$ArchitectureComboxBox.BackColor = 'White'
$ArchitectureComboxBox.DropDownStyle = 'DropDownList'
$ArchitectureComboxBox.FormattingEnabled = $True
\[void\]$ArchitectureComboxBox.Items.Add('64 bit')
\[void\]$ArchitectureComboxBox.Items.Add('32 bit')
$ArchitectureComboxBox.Location = '230, 113'
$ArchitectureComboxBox.Margin = '4, 3, 4, 3'
$ArchitectureComboxBox.Name = 'ArchitectureComboxBox'
$ArchitectureComboxBox.Size = '140, 25'
$ArchitectureComboxBox.TabIndex = 28
#
# DownloadComboBox
#
$DownloadComboBox.BackColor = 'White'
$DownloadComboBox.DropDownStyle = 'DropDownList'
$DownloadComboBox.FormattingEnabled = $True
\[void\]$DownloadComboBox.Items.Add('Drivers')
\[void\]$DownloadComboBox.Items.Add('BIOS')
\[void\]$DownloadComboBox.Items.Add('All')
$DownloadComboBox.Location = '13, 113'
$DownloadComboBox.Margin = '4, 3, 4, 3'
$DownloadComboBox.Name = 'DownloadComboBox'
$DownloadComboBox.Size = '140, 25'
$DownloadComboBox.TabIndex = 27
#
# PlatformComboBox
#
$PlatformComboBox.BackColor = 'White'
$PlatformComboBox.DropDownStyle = 'DropDownList'
$PlatformComboBox.FormattingEnabled = $True
\[void\]$PlatformComboBox.Items.Add('SCCM')
\[void\]$PlatformComboBox.Items.Add('MDT')
\[void\]$PlatformComboBox.Items.Add('Both')
$PlatformComboBox.Location = '13, 47'
$PlatformComboBox.Margin = '4, 3, 4, 3'
$PlatformComboBox.Name = 'PlatformComboBox'
$PlatformComboBox.Size = '140, 25'
$PlatformComboBox.TabIndex = 26
$PlatformComboBox.add\_SelectedValueChanged($PlatformComboBox\_SelectedValueChanged)
#
# PackagePathTextBox
#
$PackagePathTextBox.CharacterCasing = 'Upper'
$PackagePathTextBox.Font = 'Microsoft Sans Serif, 8.25pt'
$PackagePathTextBox.Location = '430, 113'
$PackagePathTextBox.Margin = '4, 3, 4, 3'
$PackagePathTextBox.Name = 'PackagePathTextBox'
$PackagePathTextBox.Size = '247, 23'
$PackagePathTextBox.TabIndex = 22
$PackagePathTextBox.Text = '\\\\SERVER\\SHARE'
#
# RepositoryTextBox
#
$RepositoryTextBox.CharacterCasing = 'Upper'
$RepositoryTextBox.Font = 'Microsoft Sans Serif, 8.25pt'
$RepositoryTextBox.Location = '430, 46'
$RepositoryTextBox.Margin = '4, 3, 4, 3'
$RepositoryTextBox.Name = 'RepositoryTextBox'
$RepositoryTextBox.Size = '247, 23'
$RepositoryTextBox.TabIndex = 21
$RepositoryTextBox.Text = '\\\\SERVER\\SHARE'
#
# OSComboBox
#
$OSComboBox.DropDownStyle = 'DropDownList'
$OSComboBox.FormattingEnabled = $True
\[void\]$OSComboBox.Items.Add('Windows 10')
\[void\]$OSComboBox.Items.Add('Windows 8.1')
\[void\]$OSComboBox.Items.Add('Windows 8')
\[void\]$OSComboBox.Items.Add('Windows 7')
$OSComboBox.Location = '230, 47'
$OSComboBox.Margin = '4, 3, 4, 3'
$OSComboBox.Name = 'OSComboBox'
$OSComboBox.Size = '140, 25'
$OSComboBox.TabIndex = 16
#
# PackagePathLabel
#
$PackagePathLabel.AutoSize = $True
$PackagePathLabel.ForeColor = 'Black'
$PackagePathLabel.Location = '430, 94'
$PackagePathLabel.Margin = '4, 0, 4, 0'
$PackagePathLabel.Name = 'PackagePathLabel'
$PackagePathLabel.Size = '108, 17'
$PackagePathLabel.TabIndex = 24
$PackagePathLabel.Text = 'Package Path'
#
# RepositoryLabel
#
$RepositoryLabel.AutoSize = $True
$RepositoryLabel.ForeColor = 'Black'
$RepositoryLabel.Location = '430, 28'
$RepositoryLabel.Margin = '4, 0, 4, 0'
$RepositoryLabel.Name = 'RepositoryLabel'
$RepositoryLabel.Size = '124, 17'
$RepositoryLabel.TabIndex = 23
$RepositoryLabel.Text = 'Repository Path'
#
# ArchitectureCheckBox
#
$ArchitectureCheckBox.AutoSize = $True
$ArchitectureCheckBox.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$ArchitectureCheckBox.ForeColor = 'Black'
$ArchitectureCheckBox.Location = '230, 94'
$ArchitectureCheckBox.Margin = '4, 0, 4, 0'
$ArchitectureCheckBox.Name = 'ArchitectureCheckBox'
$ArchitectureCheckBox.Size = '96, 17'
$ArchitectureCheckBox.TabIndex = 20
$ArchitectureCheckBox.Text = 'Architecture'
#
# lSelectDeployLabel
#
$lSelectDeployLabel.AutoSize = $True
$lSelectDeployLabel.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$lSelectDeployLabel.ForeColor = 'Black'
$lSelectDeployLabel.Location = '10, 28'
$lSelectDeployLabel.Margin = '4, 0, 4, 0'
$lSelectDeployLabel.Name = 'lSelectDeployLabel'
$lSelectDeployLabel.Size = '158, 17'
$lSelectDeployLabel.TabIndex = 14
$lSelectDeployLabel.Text = 'Deployment Platform'
#
# OperatingSysLabel
#
$OperatingSysLabel.AutoSize = $True
$OperatingSysLabel.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$OperatingSysLabel.ForeColor = 'Black'
$OperatingSysLabel.Location = '230, 28'
$OperatingSysLabel.Margin = '4, 0, 4, 0'
$OperatingSysLabel.Name = 'OperatingSysLabel'
$OperatingSysLabel.Size = '137, 17'
$OperatingSysLabel.TabIndex = 17
$OperatingSysLabel.Text = 'Operating System'
#
# labelDownloadType
#
$labelDownloadType.AutoSize = $True
$labelDownloadType.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$labelDownloadType.ForeColor = 'Black'
$labelDownloadType.Location = '10, 94'
$labelDownloadType.Margin = '4, 0, 4, 0'
$labelDownloadType.Name = 'labelDownloadType'
$labelDownloadType.Size = '119, 17'
$labelDownloadType.TabIndex = 13
$labelDownloadType.Text = 'Download Type'
#
# ModelListBox
#
$ModelListBox.AutoSize = $True
$ModelListBox.BackColor = 'Transparent'
$ModelListBox.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$ModelListBox.Location = '28, 198'
$ModelListBox.Margin = '4, 0, 4, 0'
$ModelListBox.Name = 'ModelListBox'
$ModelListBox.Size = '82, 17'
$ModelListBox.TabIndex = 4
$ModelListBox.Text = 'Model List'
#
# LoggingLabel
#
$LoggingLabel.AutoSize = $True
$LoggingLabel.BackColor = 'Transparent'
$LoggingLabel.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$LoggingLabel.Location = '28, 402'
$LoggingLabel.Margin = '4, 0, 4, 0'
$LoggingLabel.Name = 'LoggingLabel'
$LoggingLabel.Size = '129, 17'
$LoggingLabel.TabIndex = 34
$LoggingLabel.Text = 'Job Process Log'
#
# ModelProgressLabel
#
$ModelProgressLabel.AutoSize = $True
$ModelProgressLabel.BackColor = 'Transparent'
$ModelProgressLabel.Font = 'Microsoft Sans Serif, 8.25pt, style=Bold'
$ModelProgressLabel.Location = '28, 574'
$ModelProgressLabel.Margin = '4, 0, 4, 0'
$ModelProgressLabel.Name = 'ModelProgressLabel'
$ModelProgressLabel.Size = '121, 17'
$ModelProgressLabel.TabIndex = 32
$ModelProgressLabel.Text = 'Model Progress'
#
# OpenMDTFileDialog
#
$DownloadGroupBox.ResumeLayout()
$SCCMTabPage3.ResumeLayout()
$SCCMTabPage2.ResumeLayout()
$SCCMTabPage1.ResumeLayout()
$SCCMDellTabControl.ResumeLayout()
$MainForm.ResumeLayout()
#endregion Generated Form Code

#----------------------------------------------

#Save the initial state of the form
$InitialFormWindowState = $MainForm.WindowState
#Init the OnLoad event to correct the initial state of the form
$MainForm.add\_Load($Form\_StateCorrection\_Load)
#Clean up the control events
$MainForm.add\_FormClosed($Form\_Cleanup\_FormClosed)
#Store the control values when form is closing
$MainForm.add\_Closing($Form\_StoreValues\_Closing)
#Show the Form
return $MainForm.ShowDialog()

} #endregion Source: MainForm.psf

#region Source: Globals.ps1 #——————————————– # Declare Global Variables and Functions here #——————————————–

$ErrorActionPreference = 'SilentlyContinue'
$WarningPreference = 'SilentlyContinue'

# Define Dell Download Sources
$DellDownloadList = "http://downloads.dell.com/published/Pages/index.html"
$DellDownloadBase = "http://downloads.dell.com"
$DellDriverListURL = "http://en.community.dell.com/techcenter/enterprise-client/w/wiki/2065.dell-command-deploy-driver-packs-for-enterprise-client-os-deployment"
$DellBaseURL = "http://en.community.dell.com"

# ArrayList to store the Dell models in
$DellProducts = New-Object -TypeName System.Collections.ArrayList

# Log File Location
$LogFile = "$env:TEMP\\DeployEverythingDellLog.txt"

# MDT PS Commandlets
$MDTPSCommandlets = "C:\\Program Files\\Microsoft Deployment Toolkit\\bin\\MicrosoftDeploymentToolkit.psd1"

# Query SCCM Site Code
function QuerySiteCode ($SiteServer)
{
	$SiteCodeObjects = Get-WmiObject -Namespace "root\\SMS" -Class SMS\_ProviderLocation -ComputerName $SiteServer -ErrorAction Stop
	if ($SiteCodeObjects -gt $null)
	{
		foreach ($SiteCodeObject in $SiteCodeObjects)
		{
			if ($SiteCodeObject.ProviderForLocalSite -eq $true)
			{
				$SiteCode = $SiteCodeObject.SiteCode
				$ProgressListBox.Items.Add("Site Code Found: $($SiteCode)")
				$SiteCodeText.text = $SiteCode
			}
		}
	}
	else
	{
		$ProgressListBox.ForeColor = "Red"
		$ProgressListBox.Items.Add(" ")
		$ProgressListBox.Items.Add("Error Site Code Not Found: Please check your security rights to the $SiteServer server.")
	}
}

#endregion Source: Globals.ps1

#Start the application Main ($CommandLine)