Install OpsMgr Agent remotely with Powershell

As you are aware by now I’m creating a series of Powershell automation activities to automate some System Center installation tasks. Below you can find a Powershell script that will connect to the Opsmgr server remotely (so you dont need the OpsMgr powershell snappin installed locally) deploy the scom agent and enable agent proxiyng on them.