MilestoneSystemsInc / PowerShellSamples

A collection of samples for managing your Milestone XProtect VMS using MilestonePSTools in PowerShell
https://www.milestonepstools.com
MIT License
37 stars 12 forks source link

Linux Support #146

Closed aoforb closed 3 months ago

aoforb commented 3 months ago

Before I go down the rabbit hole... Has anyone got this API to work with Ubuntu using the PowerShell 7 package?

joshooaj commented 3 months ago

Hi @aoforb,

Since MilestonePSTools is built on the MilestoneSystems.VideoOS.Platform MIP SDK nuget package which targets .NET Framework 4.7.2, it requires PowerShell 5.1 which is only available on Windows.

We definitely do want to start building a cross-platform module built exclusively against our newer REST-based APIs but that work hasn't started yet - in part because the available tooling for generating .NET / PowerShell code from our openapi spec hasn't liked some aspects of our spec and I haven't had a chance to dig deeper to determine the best way to resolve those issues.

In any case, I see the value in supporting PowerShell 7+ on non-Windows systems and I appreciate you posting about your interest in it here! Can you share a little about your use case and the value of using PowerShell to work with Milestone from linux vs one of the existing Windows machines?

aoforb commented 3 months ago

Hi @joshooaj thanks for the info.

I use Ansible to deploy changes to each VMS with the win_powershell_module. It works well, just like running the script locally on the remote VMS. However, I’m facing an issue keeping the Milestone PS Tools API on the remote VMS up to date due to LTE data constraints. https://github.com/MilestoneSystemsInc/PowerShellSamples/issues/143#event-13747299518

My thought was to have this API run inside a docker container (next to the Ansible container) running powershell 7 and then I can 'delegate' the Ansible task to that container which would in turn interact with the remote VMS machine "over the air".

Although I think a better option would be look into the Rest API and come up with a python wrapper.

Hope that made sense.

Cheers

joshooaj commented 3 months ago

That makes perfect sense, thanks for sharing! I'm happy to see someone using the module in an IaC strategy, even if it can be a bit of a square peg in a round hole as a Windows-only module.

I'll close this and make sure to take another look at our openapi spec soon.