NAV 2013 R2: Powershell function to check if ServerInstance is Multitenant or not

I’m working on improving the Backup/Restore procedure from this blogpost .. . While doing that, I was looking for a way to see whether my current instance was actually a Multitenant-server or not. In a way, I had to be able to read this configuration in powershell: