Skip to content

Instantly share code, notes, and snippets.

@CodyMathis123
Last active July 22, 2019 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodyMathis123/e0f4d3a2999730ec38165f89c891618a to your computer and use it in GitHub Desktop.
Save CodyMathis123/e0f4d3a2999730ec38165f89c891618a to your computer and use it in GitHub Desktop.
switch ($No_SMS_Exists) {
$false {
Write-CMLogEntry -Value "Found that the 'No_SMS_On_Drive.sms' does not exist on $DrivePath - will check for DP folders."
$SMS_PackageShareFolder = [string]::Format('SMSPKG{0}$', $Volume.DriveLetter)
$SMS_PackageShareFolderPath = Get-ChildItem -Path $DrivePath -Filter $SMS_PackageShareFolder
if ($null -ne $SMS_PackageShareFolderPath) {
Write-CMLogEntry -Value "Adding $($SMS_PackageShareFolderPath.FullName) to inclusion list for $DrivePath"
$Include[$SMS_PackageShareFolderPath.FullName] = $true
}
$SCCMContentLibFolderPath = Get-ChildItem -Path $DrivePath -Filter 'SCCMContentLib'
if ($null -ne $SCCMContentLibFolderPath) {
Write-CMLogEntry -Value "Adding $($SCCMContentLibFolderPath.FullName) to inclusion list for $DrivePath"
$Include[$SCCMContentLibFolderPath.FullName] = $true
}
$IncludeCSV = Join-Path -Path $DrivePath -ChildPath $AdditionalIncludes
if (Test-Path -Path $IncludeCSV) {
Write-CMLogEntry -Value "CSV found for processing additional includes for deduplication - $IncludeCSV"
$ExplicitIncludes = Import-Csv -Path $IncludeCSV
foreach ($Inclusion in $ExplicitIncludes.Include) {
$Inclusion = [string]::Format('{0}\{1}', $DrivePath, $Inclusion)
Write-CMLogEntry -Value "$Inclusion added for processing"
$Include[$Inclusion] = $true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment