function obterRecursosNecessarios() {

    $recursos = "Web-Default-Doc",
    "Web-Dir-Browsing",
    "Web-Http-Errors",
    "Web-Static-Content",
    'Web-Http-Logging',
    "Web-Custom-Logging",
    "Web-Stat-Compression",
    "Web-Dyn-Compression",
    "Web-Filtering",
    "Web-Basic-Auth",
    "Web-CertProvider",
    "Web-Client-Auth",
    "Web-Digest-Auth",
    "Web-Cert-Auth",
    "Web-IP-Security",
    "Web-Windows-Auth",
    "Web-Net-Ext45",
    "Web-Asp-Net45",
    "Web-ISAPI-Ext",
    "Web-ISAPI-Filter",
    "Web-Mgmt-Console",
    "Web-Scripting-Tools",
    "Web-Mgmt-Service",
    "NET-WCF-TCP-PortSharing45",
    "Web-AppInit",
    "Hyper-V",
    "Containers",
    "Web-WebSockets",
    "Web-Http-Tracing",
    "Web-Request-Monitor"

    $recursos
    
}
    function instalarRecurso() {
        param(
        [Parameter(Mandatory = $true)]
        $nome
    )

    Write-Host "Instalando recurso $nome"

    Install-WindowsFeature -Name $nome
}

$recursos = (obterRecursosNecessarios)

foreach($recurso in $recursos) {
    instalarRecurso -nome $recurso
}

