Windows Server Manager lets you export the configured roles and features from the UI dialogue as an xml file. Unfortunately there is no possibility to directly work with this xml file. The following script shows a simple way to parse the xml file. You can then pipe the output to for example to the Install-WindowsFeature
cmdlet.
This blog series introduces a PowerShell module that automatically generated MarkDown documentation of your PowerShell Scripts and modules. It also gives an introduction into Abstract Syntax Trees (ASTs) in PowerShell.
Read more...