How to write /pass command in invoke power shell

Hello,

i dont want tomopen cmd and type command using UiPath instaed i directly need to run using invoke power shell and get output.
suppose my command is -xyz

then how can i pass directly in invoke powershell?

Hi @Mathkar_kunal

use:

  • Drag Invoke PowerShell
    CommandText → "hostname"
    IsScript → False
    TypeArgument → String
    Output → result (IEnumerable)
  • Add Assign
    hostName = String.Join("", result).Trim

Happy Automation

command text - host name not understood
where to pass the command
if my command is - dsquery * domainroot -filter “(&(objectCategory=User)(sAMAccountName=“kmathkar”))” -attr cn

where i need to pass

getting this eerror
from cmd it is running

Could you pls try this -

“cmd /c dsquery * domainroot -filter “”(&(objectCategory=User)(sAMAccountName=kmathkar))”" -attr cn"

check tis error

i got the power shell command which is working in powershell
command -
Get-ADUser -LDAPFilter ‘(&(objectCategory=User)(sAMAccountName=kmathkar))’ -Properties cn |
Select-Object -ExpandProperty cn

what i need to chnage in this command to write in invoke power shell query?
any double codes i ne to add becaes i am getting this error

help me on same. and whar ned to write in aparmeter section?

@Anil_G @prashant1603765 @Edwin_Barahona @mkankatala