SCCM 2012 Powershell – Moving bulk packages to folders

In a dev environment, I had several OSD task sequences and associated packages imported. Each one was imported from a different source path to keep them separate, but they were all imported to the root Packages node in the console

Using the powershell cmdlets for SCCM, I used the code below to reassign them to folders based on the source path property of the package. (I manually created the folders but that’s easy to script too 🙂 )

For the example of a build named “Win8import”, with a package folder named the same;

FYI – You can perform move actions on objects between folders with the cmdlet move-cmobject, which I often use when scripting to create an application or something, then put it in a particular folder, but this won’t help your query.