Scripting the BES Software Distribution Wizard for Windows

Anyone written Powershell or Python code that will allow me to take a folder with files in it, create a .tmp file out of it, grab the prefetch data and update an existing task?

This would include things like getting the sha1 and 256 hash (get-filehash in powershell) and the size value as well. I have all this but the sha1, sha256 and size is off from what the wizard does. I suspect IBM is adding things into the process.

GUI is fine but I want it in command line or scripting.

Does the BigFix Console use bfarchive to do it or something else that is internal?

The console Wizard support does allow uploads which return the hashes so you could look at some of those for examples. Its not very simple though to do.

GUI’s are fine but there should always be command line ways to do same thing.

There are definitely scriptable ways to do the same…just you have to write the scripts.

I haven’t gone through SWD extensively, but for the most part it’s REST API calls, bfarchive, and dashboard variables. The filename extension it uses is there to “tag” the files as SWD packages, the BES Server Upload Maintenance Service scavages for SWD file uploads that aren’t referenced in the dashboard anymore and removes them.

I did some testing and change get the wizard output to match bfarchive/make-prefetch output:

from console:
prefetch d081a45d1d8128ecbce9447f05cd0180ff9741ac sha1:d081a45d1d8128ecbce9447f05cd0180ff9741ac size:265 http://xxxxxx:52311/Uploads/d081a45d1d8128ecbce9447f05cd0180ff9741ac/sha1text.txt.tmp sha256:9061b8faa898eb5caa16876417872bdb77ed72564d4635beb887aa12548366a6
extract d081a45d1d8128ecbce9447f05cd0180ff9741ac

from bfarchive
BFArchive.exe -a sha1text.txt sha1text.txt.tmp
python sha1text.txt.tmp

prefetch sha1text.txt.tmp sha1:776ae16936890b13b2eaec61919a627e9c5727cb size:265 http://REPLACEME sha256:32a67bc6a35354791e3ccc362e22077597e66ba6089f135f7fef21b687f955a2

As you can see, the sha1 of the tmp file created by bfarchive dosen’t match what the wizard created.