Skip to content

Instantly share code, notes, and snippets.

@gerane
Last active August 23, 2017 15:51
Show Gist options
  • Save gerane/897de7d1c4630353f4a3dc93e8353e09 to your computer and use it in GitHub Desktop.
Save gerane/897de7d1c4630353f4a3dc93e8353e09 to your computer and use it in GitHub Desktop.
if (((Test-Path -Path $Global:SettingsDirectory\DATSettings.xml) -eq $true) -and ($Global:DATSettingsXML.Settings.DownloadSettings.DeploymentPlatform -eq 'MDT'))
{
$ProgressListBox.ForeColor = "Black"
Write-CMLogEntry -Value "======== Detecting Deployment Platform $(Get-Date) ========" -Severity 1
Write-CMLogEntry -Value "======== Deployment Platform: MDT - Skipping SCCM Validation ========" -Severity 1
}
elseif (((Test-Path -Path $Global:SettingsDirectory\DATSettings.xml) -eq $true) -and (! [string]::IsNullOrEmpty($Global:DATSettingsXML.Settings.SiteSettings.Server)))
{
$SiteServer = [string]$SiteServerInput.Text
$ProgressListBox.ForeColor = "Black"
Write-CMLogEntry -Value "======== Validating ConfigMgr Server Details $(Get-Date) ========" -Severity 1
ConnectSCCM
}
else
{
Write-CMLogEntry -Value "======== FIRST TIME RUN DETECTED ========" -Severity 1
}
function Read-XMLSettings
{
Write-CMLogEntry -Value "======== Reading Settings File ========" -Severity 1
try
{
# // Read in settings XML
[xml]$global:DATSettingsXML = Get-Content -Path "$global:SettingsDirectory\DATSettings.xml"
# Set XML Object
$global:DATSettingsXML.GetType().FullName
# ConfigMgr Site Settings
Write-CMLogEntry -Value "Setting ConfigMgr Site Settings" -Severity 1
$SiteCodeText.Text = $global:DATSettingsXML.Settings.SiteSettings.Site
$SiteServerInput.Text = $global:DATSettingsXML.Settings.SiteSettings.Server
if ($Global:DATSettingsXML.Settings.DownloadSettings.DeploymentPlatform -ne 'MDT')
{
ConnectSCCM
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment