FogApi
2508.9.23
# FOG Api Powershell Module
This is a powershell module to simplify the use of the Fog Project API.
This module is used to easily run Fog API commands on your fogserver from a powershell console or script.
FOG is an opensource tool for imaging comptuters, this module uses the API on your internal fog server to
perform almost any operation you can do in the GU
# FOG Api Powershell Module
This is a powershell module to simplify the use of the Fog Project API.
This module is used to easily run Fog API commands on your fogserver from a powershell console or script.
FOG is an opensource tool for imaging comptuters, this module uses the API on your internal fog server to
perform almost any operation you can do in the GUI of Fog and provides you with the ability to extend things further.
It can be used to create more automation or to simply have a command line method of controlling fog operations.
This essentially gives you a crossplatform commandline interface for fog tasks and makes many things easier to automate.
Docs for this module can be found at https://fogapi.readthedocs.io/en/latest/
For more information about FOG see
- https://fogproject.org/
- https://docs.fogproject.org/
- https://github.com/FOGProject
- https://github.com/FOGProject/fogproject
- https://forums.fogproject.org/
# Versioning
The versioning of this module follows this pattern
`{Year|Month}.{Major Version}.{Revision #}`
See https://github.com/darksidemilk/FogApi?tab=readme-ov-file#versioning for more info
# Usage
You can use Set-fogserverSettings to set your fogserver hostname and api keys.
Or, the first time you try to run a command the settings.json file will automatically open in an OS Specific editor.
You can also open the settings.json file and edit it manually before running your first command.
The default settings are explanations of where to find the proper settings since json cannot have comments
Once the settings are set you can utilze the fog documentation found here https://news.fogproject.org/simplified-api-documentation/ that was used to model the parameters for Get-FogObject, Update-FogObject, and Remove-FogObject.
You can also utilize simpler functions of common tasks, see the links below for more info.
# Additional info
- Examples and More: https://github.com/darksidemilk/FogApi/blob/master/README.md
- All Commands - https://fogapi.readthedocs.io/en/latest/commands/
- FogForums module thread: https://forums.fogproject.org/topic/12026/powershell-api-module/2
- Full change log available at https://fogapi.readthedocs.io/en/latest/ReleaseNotes/
Minimum PowerShell version
5.1
Installation Options
Owners
Copyright
2018-2025
Package Details
Author(s)
- JJ Fullmer FOG Project
Tags
fog fogapi imaging provisioning fogproject
Functions
Add-FogHostMac Add-FogResultData Approve-FogPendingMac Deny-FogPendingMac Disable-FogApiHTTPS Dismount-WinEfi Enable-FogApiHTTPS Find-FogObject Get-FogActiveTasks Get-FogGroupAssociations Get-FogGroupByName Get-FogGroups Get-FogHost Get-FogHostAssociatedSnapins Get-FogHostGroup Get-FogHostMacs Get-FogHostPendingMacs Get-FogHosts Get-FogImages Get-FogInventory Get-FogLog Get-FogMacAddresses Get-FogModules Get-FogObject Get-FogScheduledTasks Get-FogSecsSinceEpoch Get-FogServerSettings Get-FogServerSettingsFile Get-FogSetting Get-FogSettings Get-FogSnapinAssociations Get-FogSnapins Get-FogVersion Get-LastImageTime Get-WinBcdPxeID Get-WinEfiMountLetter Install-FogService Invoke-FogApi Mount-WinEfi New-FogHost New-FogObject Receive-FogImage Remove-FogObject Remove-UsbMac Repair-FogSnapinAssociations Reset-HostEncryption Resolve-HostID Send-FogImage Send-FogWolTask Set-FogHostImage Set-FogInventory Set-FogServerSettings Set-FogServerSettingsFileSecurity Set-FogSetting Set-FogSnapins Set-WinToBootToPxe Start-FogSnapin Start-FogSnapins Test-FogVerAbove1dot6 Test-StringNotNullOrEmpty Update-FogObject
PSEditions
Dependencies
This module has no dependencies.
Release Notes
# 2508.9.23
Fix #41 and add some other user experience improvements (#42)
* Error in send-fogimage command
Fixes #41 When powershell 5.1 is used, invoke-restmethod and invoke-webrequest don't auto change the method from GET to POST when a body exists in the call. Added a check in invoke-fogapi for if body is not null and method is get, when true will change to a POST method.
* Also added a failsafe try/catch in Get-FogScheduledTasks in case this still happens somehow. It will catch if the result is null.
* Also found that active tasks weren't always being force closed with -force. Changed the null/count check for active tasks to ensure they get canceled when -force is used with send-fogimage and ensured that both existing scheduled tasks and active tasks are checked for by separating their if/else branches.
* Minor changes to setting fog settings. Fixing erroneous error when setting the security of the settings file as a standard user, set-acl was displaying an error even though it was being caught and falling back to icacls which works for a standard user. Also changed to using the internal Test-StringNotNullOrEmpty function for null checks when setting settings.
* Add how to download and import a temp version of the dev branch module.
* Add linux compatible dev import in readme.
* Fixed a warning message typo
* Pull help text from default settings file instead of hard coding it so only 1 place to update. Also testing for whitespace in apitokens and server name as a fallback for testing validity. Added a catch for if the fogserver name is specified as just a hostname, it will prepend http:// in this case and display a warning.
* added a timer so linux users can read the warning before the editor opens to manually edit the settings file
* display message about the wait before opening the commandline editor for linux users
* default to vi instead of nano
* added Quick vi/nano edit tips
Full change log history available at https://fogapi.readthedocs.io/en/latest/ReleaseNotes/
FileList
- FogApi.nuspec
- FogApi.psm1
- en-us\FogApi-help.xml
- lib\settings.json
- FogApi.psd1
- en-us\about_FogApi.help.txt
- icons\favicon.png
Version History
Version | Downloads | Last updated |
---|---|---|
2509.9.25 | 411 | 9/11/2025 |
2508.9.23 (current version) | 979 | 8/20/2025 |
2506.9.22 | 1,092 | 6/17/2025 |
2506.9.21 | 16 | 6/16/2025 |
2506.9.20 | 8 | 6/16/2025 |
2506.9.19 | 6 | 6/16/2025 |
2505.9.18 | 202 | 5/14/2025 |
2411.9.17 | 8,697 | 11/17/2024 |
2409.9.16 | 5,038 | 9/14/2024 |
2409.9.4 | 853 | 9/4/2024 |
2408.9.3 | 567 | 8/30/2024 |
2408.9.2 | 576 | 8/22/2024 |
2311.6.4 | 17,245 | 11/17/2023 |
2310.6.3 | 564 | 10/11/2023 |
2310.6.2 | 14 | 10/11/2023 |
2304.5.41 | 3,936 | 4/12/2023 |
2302.5.40 | 11 | 4/12/2023 |
2302.5.33 | 331 | 3/29/2023 |
2302.5.26 | 47 | 3/1/2023 |
2209.4.5 | 223 | 10/21/2022 |
2209.4.1 | 351 | 10/12/2022 |
2208.3.3 | 594 | 8/24/2022 |
2208.3.1 | 21 | 8/23/2022 |
2103.2.13 | 19 | 8/23/2022 |
2103.2.12 | 1,927 | 3/26/2021 |
2004.2.2.7 | 75 | 12/3/2020 |
2004.2.2.4 | 28 | 11/17/2020 |
2002.2.1.2 | 81 | 4/21/2020 |
1903.0.0.22 | 97 | 9/25/2019 |
1.6 | 286 | 6/11/2018 |
1.2 | 32 | 6/5/2018 |