1 Reply Latest reply on Dec 7, 2017 2:50 PM by jordan.swan

    Thoughts Wanted On Refactoring the PowerOrion PowerShell Module

    Michael Halpin

      Hi Folks.


      Since the (unofficial) PowerOrion module I worked on a few years ago has gone a bit stale, I've decided to invest some time in revamping the existing functionality, and then expanding on it.


      Some of my thoughts at present include:

      • Publishing and updating it separately from the main Orion SDK
      • Breaking cmdlets out into individual files. This should make it easier to scale, and should also simplify the next point
      • Adding Unit Tests.
      • Increasing performance by rewriting cmdlets where possible to use native bulk update functionality.
      • Extending support for other use cases.
      • Publishing to the PowerShell gallery, to simplify installation of the module  (such as the IPAM functionality)


      One of the biggest drivers for me however, is the unit testing. By writing tests first for each cmdlet, it will be possible ensure that the cmdlets work as designed, and changes to the code later won't break anything. 


      I've set up a new repo for the module over on Github. The plan at present is to refactor the old code first, and write the unit tests for each functionality, just to come up to parity with the existing code (fixing bugs along the way!). Then the module will be published to the gallery. Going forward then there will be a good framework in place for newer functionality.https://github.com/solarwinds/PowerOrion


      What I would like to ask of the Thwack community is for feedback on the above, but also, what cmdlets would you like to see added? Perhaps you have a short script that can be converted to a function, to allow code reuse? Or did you find bugs in the existing module that I might have missed?  I've started tracking the work to be done on the issues page, so if there is anything enhancements/bugs etc please either add an issue over on Github, or in the comments below.

        • Re: Thoughts Wanted On Refactoring the PowerOrion PowerShell Module


          I spent a little bit of time trying to get the PowerOrion Powershell Module working for me at my current position, but something that wasn't available was a way to add SNMPv3 Nodes via the PowerOrion module. I think it may be worth while to add in the ability to utilize the discovery profiles via a cmdlet.


          Again, I am not 100% that you haven't already done this, but if you haven't I would really love to see it added.