• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Powershell API Module

Scheduled Pinned Locked Moved
Tutorials
api api help powershell task management fogapi-psmodule
7
31
8.3k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W
    Wayne Workman @JJ Fullmer
    last edited by Sep 25, 2019, 11:41 PM

    @JJ-Fullmer I commented on your PR, I’m concerned about the licensing.

    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
    Daily Clean Installation Results:
    https://fogtesting.fogproject.us/
    FOG Reporting:
    https://fog-external-reporting-results.fogproject.us/

    1 Reply Last reply Reply Quote 1
    • J
      JJ Fullmer Testers @JJ Fullmer
      last edited by JJ Fullmer Apr 15, 2020, 5:34 PM Apr 13, 2020, 4:49 PM

      Due to current global pandemic conditions I find myself with some extra time to work on this. I do also have an infant, so not a ton of time, but more than I usually have to work on these kinds of projects.

      I am currently thinking I will focus on the following things in the module but would love input on any features people would like in an API module out of the box.

      • Creating a readthedocs or github pages based webpage for help files integrated with powershell’s get-help {function-Name} -online functionality. i.e. https://github.com/darksidemilk/FogApi is a rough draft
      • Moving the api to its own repo following best practices for powershell modules. https://github.com/darksidemilk/FogApi.
      • Update the build script to utilize the new structure and documentation needs
      • Make sure each existing function has documentation, especially including examples
      • Make it compatible with Powershell 7 (ideally without losing powershell 5 compatibility)
      • Once compatible with powershell 7, add more cross platform compatibility for linux and mac (though I don’t have a way to test mac functionality) on all existing functions
      • Add Functions for more common fog tasks (Hoping to get some requests to know where focus is best spent)
      • Make it so the return object will work with the small api changes in fog 1.6 by making it just return just the content as the count is automatically included in a powershell object or changing the return object in some way that isn’t a breaking change. i.e. it currently returns something like
      count: 100
      hosts: {hostJsonContent}
      

      in 1.6 I understand it will change to

      count: 100
      data: {hostJsonContent}
      

      So I may utilize some method to make it so everything returns an object with count and data or just data or something based on what fog version you have. May also add additional 1.6 options if time permits (I understand there are join functions, and options to return just a specific parameter/member of an object or objects, or at least those were the plans 2 years ago)

      • Make it so there’s more pipeable commands. i.e. you put some host in a variable and then just pipe it to actions
      Get-FogHost -hostname computername | Add-FogHostMac -macaddress "12:34:56:78:90"
      

      This would probably take quite some time to add

      We’ll see how much of this I’m able to do in the undetermined amount of time this pandemic has me at home all day.

      Have you tried the FogApi powershell module? It's pretty cool IMHO
      https://github.com/darksidemilk/FogApi
      https://fogapi.readthedocs.io/en/latest/
      https://www.powershellgallery.com/packages/FogApi
      https://forums.fogproject.org/topic/12026/powershell-api-module

      J 1 Reply Last reply Oct 6, 2020, 1:32 PM Reply Quote 1
      • J
        JJ Fullmer Testers
        last edited by Apr 21, 2020, 10:26 PM

        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.2

        The 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/FogApi

        Hopefully 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.

        Have you tried the FogApi powershell module? It's pretty cool IMHO
        https://github.com/darksidemilk/FogApi
        https://fogapi.readthedocs.io/en/latest/
        https://www.powershellgallery.com/packages/FogApi
        https://forums.fogproject.org/topic/12026/powershell-api-module

        1 Reply Last reply Reply Quote 2
        • J
          JJ Fullmer Testers @JJ Fullmer
          last edited by Oct 6, 2020, 1:32 PM

          This module appears to have gained some popularity…
          5f36ea7f-6fa6-43ae-b64c-13bb3b2968b6-image.png

          Maybe I need to find some time to do more updating.

          Have you tried the FogApi powershell module? It's pretty cool IMHO
          https://github.com/darksidemilk/FogApi
          https://fogapi.readthedocs.io/en/latest/
          https://www.powershellgallery.com/packages/FogApi
          https://forums.fogproject.org/topic/12026/powershell-api-module

          J 1 Reply Last reply Nov 17, 2020, 7:03 PM Reply Quote 1
          • J
            JJ Fullmer Testers @JJ Fullmer
            last edited by Nov 17, 2020, 7:03 PM

            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 handling

            Released 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)

            Have you tried the FogApi powershell module? It's pretty cool IMHO
            https://github.com/darksidemilk/FogApi
            https://fogapi.readthedocs.io/en/latest/
            https://www.powershellgallery.com/packages/FogApi
            https://forums.fogproject.org/topic/12026/powershell-api-module

            J 1 Reply Last reply Nov 20, 2020, 10:38 PM Reply Quote 0
            • J
              JJ Fullmer Testers @JJ Fullmer
              last edited by Nov 20, 2020, 10:38 PM

              See also this post if you’re searching for how to create scheduled tasks via the api
              https://forums.fogproject.org/post/139328

              Have you tried the FogApi powershell module? It's pretty cool IMHO
              https://github.com/darksidemilk/FogApi
              https://fogapi.readthedocs.io/en/latest/
              https://www.powershellgallery.com/packages/FogApi
              https://forums.fogproject.org/topic/12026/powershell-api-module

              1 Reply Last reply Reply Quote 0
              • J
                Jamaal @JJ Fullmer
                last edited by Mar 13, 2021, 11:37 PM

                @jj-fullmer

                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.parameter not recognized.PNG

                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.parameter 2.PNG

                J 1 Reply Last reply Mar 18, 2021, 2:09 PM Reply Quote 1
                • J
                  JJ Fullmer Testers @Jamaal
                  last edited by Mar 18, 2021, 2:09 PM

                  @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.

                  Have you tried the FogApi powershell module? It's pretty cool IMHO
                  https://github.com/darksidemilk/FogApi
                  https://fogapi.readthedocs.io/en/latest/
                  https://www.powershellgallery.com/packages/FogApi
                  https://forums.fogproject.org/topic/12026/powershell-api-module

                  J 1 Reply Last reply Mar 19, 2021, 9:19 AM Reply Quote 0
                  • J
                    Jamaal @JJ Fullmer
                    last edited by Mar 19, 2021, 9:19 AM

                    @jj-fullmer said in Powershell API Module:

                    vscode

                    Thanks jj,

                    I’ll install & try out.

                    1 Reply Last reply Reply Quote 1
                    • J
                      JJ Fullmer Testers
                      last edited by Mar 26, 2021, 5:18 PM

                      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

                      https://www.powershellgallery.com/packages/FogApi/2103.2.12

                      Have you tried the FogApi powershell module? It's pretty cool IMHO
                      https://github.com/darksidemilk/FogApi
                      https://fogapi.readthedocs.io/en/latest/
                      https://www.powershellgallery.com/packages/FogApi
                      https://forums.fogproject.org/topic/12026/powershell-api-module

                      1 Reply Last reply Reply Quote 0
                      • Chris WhiteleyC
                        Chris Whiteley
                        last edited by Dec 2, 2021, 4:57 PM

                        @JJ-Fullmer,

                        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!

                        J 1 Reply Last reply Aug 23, 2022, 5:18 PM Reply Quote 0
                        • J
                          JJ Fullmer Testers @Chris Whiteley
                          last edited by Aug 23, 2022, 5:18 PM

                          @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 a get-lastimagetime function that will default to prompting you to scan a serial number barcode
                          These will be published shortly.

                          -JJ

                          Have you tried the FogApi powershell module? It's pretty cool IMHO
                          https://github.com/darksidemilk/FogApi
                          https://fogapi.readthedocs.io/en/latest/
                          https://www.powershellgallery.com/packages/FogApi
                          https://forums.fogproject.org/topic/12026/powershell-api-module

                          Chris WhiteleyC 1 Reply Last reply Aug 24, 2022, 12:02 AM Reply Quote 1
                          • J
                            JJ Fullmer Testers @JJ Fullmer
                            last edited by Aug 23, 2022, 6:08 PM

                            @jj-fullmer
                            A new Major version has been released along with a quick feature revision shortly after

                            see
                            https://github.com/darksidemilk/FogApi/releases/tag/2208.3.0
                            and
                            https://github.com/darksidemilk/FogApi/releases/tag/2208.3.1

                            for 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.

                            Have you tried the FogApi powershell module? It's pretty cool IMHO
                            https://github.com/darksidemilk/FogApi
                            https://fogapi.readthedocs.io/en/latest/
                            https://www.powershellgallery.com/packages/FogApi
                            https://forums.fogproject.org/topic/12026/powershell-api-module

                            1 Reply Last reply Reply Quote 0
                            • Chris WhiteleyC
                              Chris Whiteley @JJ Fullmer
                              last edited by Aug 24, 2022, 12:02 AM

                              @jj-fullmer

                              I will check it out! Late is better than never! Appreciate your work on this.

                              1 Reply Last reply Reply Quote 0
                              • george1421G george1421 referenced this topic on Feb 23, 2023, 12:48 PM
                              • J JJ Fullmer referenced this topic on Feb 25, 2023, 7:53 PM
                              • J
                                JJ Fullmer Testers @JJ Fullmer
                                last edited by Mar 1, 2023, 8:51 PM

                                @JJ-Fullmer
                                A new version has been published!

                                Release notes here:

                                https://github.com/darksidemilk/FogApi/releases/tag/2303.5.26

                                Have you tried the FogApi powershell module? It's pretty cool IMHO
                                https://github.com/darksidemilk/FogApi
                                https://fogapi.readthedocs.io/en/latest/
                                https://www.powershellgallery.com/packages/FogApi
                                https://forums.fogproject.org/topic/12026/powershell-api-module

                                Chris WhiteleyC 1 Reply Last reply Mar 1, 2023, 11:18 PM Reply Quote 1
                                • Chris WhiteleyC
                                  Chris Whiteley @JJ Fullmer
                                  last edited by Mar 1, 2023, 11:18 PM

                                  @JJ-Fullmer Thanks for your great work!

                                  1 Reply Last reply Reply Quote 1
                                  • J
                                    JJ Fullmer Testers @JJ Fullmer
                                    last edited by Mar 30, 2023, 3:44 PM

                                    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

                                    Have you tried the FogApi powershell module? It's pretty cool IMHO
                                    https://github.com/darksidemilk/FogApi
                                    https://fogapi.readthedocs.io/en/latest/
                                    https://www.powershellgallery.com/packages/FogApi
                                    https://forums.fogproject.org/topic/12026/powershell-api-module

                                    J 1 Reply Last reply Apr 12, 2023, 3:54 PM Reply Quote 1
                                    • J
                                      JJ Fullmer Testers @JJ Fullmer
                                      last edited by Apr 12, 2023, 3:54 PM

                                      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

                                      Have you tried the FogApi powershell module? It's pretty cool IMHO
                                      https://github.com/darksidemilk/FogApi
                                      https://fogapi.readthedocs.io/en/latest/
                                      https://www.powershellgallery.com/packages/FogApi
                                      https://forums.fogproject.org/topic/12026/powershell-api-module

                                      J 1 Reply Last reply Oct 11, 2023, 7:00 PM Reply Quote 0
                                      • J
                                        JJ Fullmer Testers @JJ Fullmer
                                        last edited by JJ Fullmer Oct 11, 2023, 3:31 PM Oct 11, 2023, 7:00 PM

                                        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

                                        Have you tried the FogApi powershell module? It's pretty cool IMHO
                                        https://github.com/darksidemilk/FogApi
                                        https://fogapi.readthedocs.io/en/latest/
                                        https://www.powershellgallery.com/packages/FogApi
                                        https://forums.fogproject.org/topic/12026/powershell-api-module

                                        J 1 Reply Last reply Nov 17, 2023, 7:09 PM Reply Quote 1
                                        • J
                                          JJ Fullmer Testers @JJ Fullmer
                                          last edited by Nov 17, 2023, 7:09 PM

                                          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 ones

                                          Release notes: https://github.com/darksidemilk/FogApi/releases/tag/2311.6.4
                                          PSGallery: https://www.powershellgallery.com/packages/FogApi/2311.6.4

                                          Have you tried the FogApi powershell module? It's pretty cool IMHO
                                          https://github.com/darksidemilk/FogApi
                                          https://fogapi.readthedocs.io/en/latest/
                                          https://www.powershellgallery.com/packages/FogApi
                                          https://forums.fogproject.org/topic/12026/powershell-api-module

                                          J 1 Reply Last reply Aug 25, 2024, 4:26 PM Reply Quote 0
                                          • 1
                                          • 2
                                          • 1 / 2
                                          • First post
                                            Last post

                                          177

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project