The linked article has several steps. Let's see what Powershell can do for each of them.
The first step is to add the Management Service Role.
Per this Microsoft documentation:
Install-WindowsFeature -Name <feature_name> -computerName <computer_name> -Restart
get-windowsfeature -computername, I find that the name of the IIS Management Service role is
Web-Mgmt-Service, we'll use this:
Install-WindowsFeature -Name Web-Mgmt-Service -computerName <computer_name> -Restart
Once installed, you need to start the Web Management Service.
This should do the trick:
Get-Service -ComputerName <computername> -Name WMSvc | Start-Service -Verbose
Change it to Automatic if you plan on using this feature often.
Get-Service -ComputerName <computername> -Name WMSvc | Set-Service -StartupType Automatic
Next, set the EnableRemoteManagement attribute in the Registry to 1
From this Microsoft scripting blog:
Use a combination of
This MCPMag.com article does the same thing, with slightly different commands.
Next, login to the server where you want to remote manage your IIS servers from. Open the IIS management console and click File -> Connect to a Server
I haven't found a Powershell way to do this part yet. It appears that saved connections are stored in
%AppData%\Microsoft\WebManagement\188.8.131.52\InetMgr.preferences, although the format isn't obvious. But the above commands will allow you to automate most of what you are asking for.