def _psrdp(cmd):
 rdp = '$RDP = Get-WmiObject -Class Win32_TerminalServiceSetting -Namespace root\\CIMV2\\TerminalServices -Computer . -Authentication 6 -ErrorAction Stop'
 return __salt__['cmd.run']('{0} ; {1}'.format(rdp, cmd), shell='powershell', python_shell=True)

def _psrdp ( cmd ) : rdp = '$RDP = Get-WmiObject -Class Win32_TerminalServiceSetting -Namespace root\\CIMV2\\TerminalServices -Computer . -Authentication 6 -ErrorAction Stop' return __salt__ [ 'cmd.run' ] ( '{0} ; {1}' . format ( rdp , cmd ) , shell = 'powershell' , python_shell = True )
create a win32_terminalservicesetting wmi object as $rdp and execute the command cmd returns the stdout of the command .