Skip to content
This repository has been archived by the owner on Nov 13, 2018. It is now read-only.

Commit

Permalink
[BUG] For PS 2.0, due to wrong variables scopes.
Browse files Browse the repository at this point in the history
  • Loading branch information
masc committed Apr 6, 2014
1 parent 48a67a6 commit 5903f64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion SCCM_Collection.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,12 @@ Function Get-SCCMCollectionsForComputer {
$computerCollectionIds += $collectionMember.CollectionID
}

# Now that we have a list of collection IDs, we want to retrieve and return some rich collection objects
# Now that we have a list of collection IDs, we want to retrieve and return some rich collection objects
if ($psversiontable.psversion.major -le 3){
$collectionId = $collectionName = $null # It may be set in a parent scope. Not needed in PS >= 3.0
}
$allServerCollections = Get-SCCMCollection -siteProvider $siteProvider -siteCode $siteCode

$computerCollections = @()
foreach($collectionId in $computerCollectionIds) {
foreach($collection in $allServerCollections) {
Expand Down

0 comments on commit 5903f64

Please sign in to comment.