File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,16 @@ function Retire-CMApplication {
3737 # remove content from all dp's and dpg's
3838 Write-Host - NoNewline " Removing content from all distribution points"
3939 $DPs = Get-CMDistributionPoint - AllSite
40- foreach ($DP in $DPs ) {
40+ foreach ($DP in $DPs )
41+ {
42+ $dpNetworkOSPath = $dp.NetworkOSPath # TODO: unify 2 variables
43+ $dpName = ($dp.NetworkOSPath ).Substring(2 , $dpNetworkOSPath.Length - 2 )
4144 Write-Host - NoNewline " ."
42- try {
43- Remove-CMContentDistribution - Application $RetiringApp - DistributionPointName ($DP ).NetworkOSPath - Force - EA SilentlyContinue
44- } catch { }
45+ try
46+ {
47+ Remove-CMContentDistribution - ApplicationName " $RetiringApp " - DistributionPointName $dpName - Force - EA SilentlyContinue
48+ }
49+ catch { }
4550 }
4651 Write-Host
4752 Write-Host - NoNewline " Removing content from all distribution point groups"
You can’t perform that action at this time.
0 commit comments