Hi PKlapwijk I added a foreword to the blog to explain the reasoning behind the decision to create a similar script.
"I used this as a learning opportunity to get a better understanding of the logic behind the whole migration process. I also needed a specific and automated way to analyze ConfigMgr apps to see if a migration could be possible and an Intune upload function."
I wasn't able to contribute to Ben's solution directly, but encouraged Ben to copy any lines of code to complement or finish his solution.
Hi Leo_Prince there seems a quotation mark missing at the end of the provider fqdn in your command.
But the error: "invalid namespace" does not seem to come from that. I guess you changed the domain and missed the quotation mark just in the comment!? So, my guess would be that either the sitecode is wrong or there is no SMS provider installed on LTCH-5CD202BRWF.
Hope this helps.