I have a PowerShell script that installs IIS & WebDeploy among other things on a Windows Server 2019. I am aware that I can grant permissions to IIS Manager Permissions using:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Management") [Microsoft.Web.Management.Server.ManagementAuthorization]::Grant($deploymentAccount, $ApplicationName, $false)
Most of the other script uses the newer IISAdministration cmdlets. Is there a newer way of granting the permissions that is a little nicer to read?