powershell - rdesktop shell escaping issue -


i'm trying send this:

get-wmiobject win32_pnpentity |where{$_.deviceid.startswith("pci\ven_10de") -or $_.deviceid.startswith("pci\ven_1002")} 

over rdesktop like:

rdesktop -a8 209.** -u ** -p ** -s "cmd.exe /k powershell.exe get-wmiobject win32_pnpentity |where{\$_.deviceid.startswith("pci\ven_10de") -or $_.deviceid.startswith("pci\ven_1002")}" 

but windows' shell says:

'where{$_.deviceid.startswith' not recognized internal or externa.... 

what doing wrong?

why not using powershell wmi remoting?

$cred = get-credential get-wmiobject win32_pnpentity -computername myremotecomputername - credential $cred |where{$_.deviceid.startswith("pci\ven_10de") -or $_.deviceid.startswith("pci\ven_1002")}  

-credential needed if actual user running powershell isn't administrator of remote machine.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -