You may use the script below to install the File, Print, DFS, and Windows Server Backup roles on a Microsoft Windows Server 2012 R2 operating system.

<#
.SYNOPSIS
Install File, Print, DFS and Windows Server Backup roles and features.
.DESCRIPTION
Automate the install of the File, Print, DFS and Windows Server Backup roles and features.
.EXAMPLE
N/A.
.AUTHOR
Written by Noel Enrique Alvarez on Monday, November 16, 2015.
#>

#Install the File Server and File Server Resource Manager roles
Install-WindowsFeature -Name FS-FileServer -IncludeAllSubFeature -IncludeManagementTools
Install-WindowsFeature -Name FS-Resource-Manager -IncludeAllSubFeature -IncludeManagementTools

#Pause for (5) seconds
Start-Sleep 5

#Install the DFS Namespaces role
Install-WindowsFeature -Name FS-DFS-Namespace -IncludeAllSubFeature -IncludeManagementTools

#Pause for (5) seconds
Start-Sleep 5

#Install the Print Server role
Install-WindowsFeature -Name Print-Server -IncludeAllSubFeature -IncludeManagementTools

#Pause for (5) seconds
Start-Sleep 5

#Install the Windows Server Backup feature
Install-WindowsFeature -Name Windows-Server-Backup -IncludeAllSubFeature -IncludeManagementTools

#End of script