I have an on-premises SharePoint 2013 farm with a configured and working App Catalog. I'm trying to script site deployment and configuration using PowerShell. How do I add and trust an app to the site using PowerShell?
I can do so using Import-SPAppPackage and Import-SPApp but Import-SPAppPackage requires the path to the *.app file. This seems unnecessary as the *.app file has already been uploaded to the App Catalog. The site provisioning script shouldn't need access to the *.app files to add an app from the catalog. Is this creating a duplicate to the app in the App Catalog?