Get HostPlatform

Two business are using it, one is hosting on a Mac with both Mac and Windows clients, one is hosting on a Windows machine with windows clients. I’d like to script it to work on any system rather than customize each one.