When you try to install RDS role on server 2012 R2 using standard deployment, this issue may occur (Figure 1).
“Unable to connect to the server by using Windows PowerShell remoting”.

Figure 1

Figure 1: Unable to connect to the server by using Windows PowerShell remoting
First of all, we need to verify the configurations as it suggested:
1. The server must be available by using Windows PowerShell remotely.
2. The server must be joined to a domain.
3. The server must be running at least Windows Server 2012 R2.
4. The currently logged on user must be a member of the local Administrators group on the server.
5. Remote Desktop Services connections must be enabled by using Group Policy.
In addition, we need to check if the “Windows Remote Management “service is running and related firewall exceptions have been created for WinRM listener.
To enabling PowerShell remoting, we can run this PowerShell command as administrator (Figure 2).
Enable-PSRemoting -Force

Figure 2


Figure 2: Enable PowerShell Remoting
However, if issue persists, we need to check whether it has enough memory to work.
By default, remote shell allots only 150 MB of memory. If we have IIS or SharePoint App pool, 150 MB of memory is not sufficient to perform the remoting task. Therefore, we need to increase the memory via the PowerShell command below:
Set-Item WSMan:localhostShellMaxMemoryPerShellMB 1000
Then, you need to restart the server and the issue should be resolved.