We can use .\AppCmd to add a site or AppPool in IIS as follows:
Login to Command Prompt as admin and change the directory to inetsrv. Then before executing the following command make sure you have correct XML files at C:\Temp location
Type C:\Temp\Site.xml | .\AppCmd Add Site /in
However, you may get a message: Failed to add Duplicate Object. This issue while adding the site may not be due to another site with the same name, however it is possible that another site exists on the server with same ID and that may cause this error.
To resolve this, open the site.xml file or the xml file where you exported the site configuration and look for the ID and change it to another number.
To choose that number it is useful to find out how many sites are already there so that you choose the right ID number for new site. You can run Get-IISSite command to see the list and IDs of currently hosted sites