Powershell API Module
-
A new version has been published!
I haven’t yet completed all my goals. But about half or more of the functions have at least one example in their help file and there is now an online home for the documentation.
You can find the published listing here
https://www.powershellgallery.com/packages/FogApi/2002.2.1.2The documentation is now at https://fogapi.readthedocs.io/en/latest/
and the module’s code is now in its own repository at https://github.com/darksidemilk/FogApiHopefully more updating still to come in the near future.
I have thoughts and plans on creating a custom class for ‘fogObjects’ returned from the api to make things more universal throughout and make creating pipeline functions easier. Want to make it so most functions have 3 parameter sets that include performing the operation by id, name, or by object. We’ll see when I get to that. -
This module appears to have gained some popularity…
Maybe I need to find some time to do more updating.
-
Sadly that 27k downloads was a glitch on the psgallery site.
But I still did do some updating to fix a couple bugs I just found. Nothing major, just a couple tweaks to fix pending mac address handlingReleased Version 2004.2.2.4
https://www.powershellgallery.com/packages/FogApi/2004.2.2.4
Release notes - https://fogapi.readthedocs.io/en/latest/ReleaseNotes/ (see versions 2004.2.2.1 - 2004.2.2.4 for changes) -
See also this post if you’re searching for how to create scheduled tasks via the api
https://forums.fogproject.org/post/139328 -
Hello, jj,
Thanks for the fog api notes, appreciate you helping us out. I’m not sure if you remembered me, but have a few questions.
I’m trying to do 2 things. One to assign a group to a machine one created in fog via powershell. I tried get-foggroupbyname, but says the parameter is not recognized.
It then told me to go to c:\program files… until I got to fogapi.psm1
I copied and pasted the command for cmdletBinding.
It didn’t error out, but didn’t return anything. Ex; , I know I created a Sales group in the Fog Gui with snapins assigned to it, so I wanted the machine to be assigned to that group to make it more dynamic. Please see attached pics. I’ll keep trying as well on my side. I’m so so on Powershell, but came a long way.
-
@jamaal I see that you’re using the powershell ISE. While that is still a great tool, I would personally recommend giving vscode with the powershell extension a try. That’s what I use for all my development and find it faster and easier to use.
-
-
A new small bugfix and feature release has just been published.
This fixes issues related to getting fog groups and adds functions for creating fog hosts.https://github.com/darksidemilk/FogApi/releases/tag/2103.2.12
-
I had a feature request for the API. I am looking at trying to output the last time the computer was imaged so that when I scan the serial I can get that info direct out of PS. Have I just missed it or is that not in there?
Thanks!
-
@chris-whiteley Sorry for the insanely delayed reply.
So you’re looking to find a host by the serial number? And then get the last time it was imaged?
I was coming here to post information on my recent update, but this sounded useful so I went ahead and implemented getting a foghost by the serialnumber in the inventory field and even aget-lastimagetime
function that will default to prompting you to scan a serial number barcode
These will be published shortly.-JJ
-
@jj-fullmer
A new Major version has been released along with a quick feature revision shortly aftersee
https://github.com/darksidemilk/FogApi/releases/tag/2208.3.0
and
https://github.com/darksidemilk/FogApi/releases/tag/2208.3.1for details on what’s been added.
Some highlights include
Deploy-FogImage and Capture-FogImage functions to start deploy and capture tasks on fog hosts from powershell both instant and scheduled.
You could always do this, but it’s now simplified in helper functions. -
I will check it out! Late is better than never! Appreciate your work on this.
-
G george1421 referenced this topic on
-
J JJ Fullmer referenced this topic on
-
@JJ-Fullmer
A new version has been published!Release notes here:
https://github.com/darksidemilk/FogApi/releases/tag/2303.5.26
-
@JJ-Fullmer Thanks for your great work!
-
A minor update has been released
Release notes: https://github.com/darksidemilk/FogApi/releases/tag/2303.5.33
PSgallery Listing: https://www.powershellgallery.com/packages/FogApi/2302.5.33 -
A minor bugfix update has been released
Release notes: https://github.com/darksidemilk/FogApi/releases/tag/2304.5.41
PSgallery Listing: https://www.powershellgallery.com/packages/FogApi/2304.5.41 -
A minor bugfix update has been released…and then something more was caught (aliases for functions weren’t being exported) and another version was released right after
Release notes: https://github.com/darksidemilk/FogApi/releases/tag/2310.6.3
PSGallery: https://www.powershellgallery.com/packages/FogApi/2310.6.3 -
Another minor bugfix release, I left a random ‘a’ at the end of a line.
Also added a switch to set-fogsnapins for running the repair-fogsnapinassociations before attempting to add new onesRelease notes: https://github.com/darksidemilk/FogApi/releases/tag/2311.6.4
PSGallery: https://www.powershellgallery.com/packages/FogApi/2311.6.4 -
A major version update has been released!
Added various functions and some new features. If you’re using fog 1.6 beta I added some tab complete of your server’s host names dynamically (the api in 1.6 is much faster, so there’s less overhead in making the call to list host names).
Also added a get-fogversion and various other requested features.One big and often requested thing included is a
Set-WinToBootToPxe
function that attempts to find the pxe boot entry in a windows hosts bcedit /enum {fwbootmgr} and sets it as the first boot option. I’ve used it with much success in my environment but I need feedback from other environments to make it truly universal.Another big update is pipeline support. It’s not quite yet as universal as I want, but I added things like
get-foghost -hostname somename | add-foghostmac -macaddress 00:00:00:00:00:00
Release notes: https://github.com/darksidemilk/FogApi/releases/tag/2408.9.2
Full change log:
https://github.com/darksidemilk/FogApi/compare/2311.6.4...2408.9.2
PSGallery: https://www.powershellgallery.com/packages/FogApi/2408.9.2 -
A patch version update has been released!
-
Fixed an issue with github actions where the release build step wasn’t committing because no user or email address was set, made the github actions bot be the author on those.
-
Fixed a typo in the Set-FogSnapins $pkglist param definition, somehow had accidentally made it just string instead of a string array which broke some of my internal scripts so i quickly patched it in case it broke anyone elses
-
As a side note, if anyone is curious as to why it jumped from xxxx.6.x to xxxx.9.x that was an accident that I didn’t notice till today… It should have been 2408.7.x. It was probably a typo or I forgot to revert it after the tests of the new build and release system. Since there were already 500+ downloads on xxxx.9.2 I’m not going to go deleting those versions and redoing them as xxxx.7.x. Apologies if anyone caught that and was confused
Release notes: https://github.com/darksidemilk/FogApi/releases/tag/2408.9.3
Full change log:
https://github.com/darksidemilk/FogApi/compare/2408.9.2...2408.9.3
PSGallery: https://www.powershellgallery.com/packages/FogApi/2408.9.3 -