andrebocchini/sccm-powershell-automation-module — pull request #4 by masantiago (2014-04-06 20:35:51+00:00)
Title: [BUG] For PS 2.0, due to wrong variables scopes.

You can try the following use case using: (powershell -version 2)

```
Add-SCCMComputerToCollection -resourceId $computer.ResourceID -collectionId $collectionId
```

It raises an exception. The source of the problem has to do with wrong retrieval of all collections at Get-SCCMCollectionsForComputer.

```
$allServerCollections = Get-SCCMCollection -siteProvider $siteProvider -siteCode $siteCode
```