Windows Server TechCenter > Windows Server Forums > Windows PowerShell > how cound power shell use the command "OPTION"
Ask a questionAsk a question
 

Answerhow cound power shell use the command "OPTION"

  • Wednesday, November 04, 2009 9:22 AM李连杰 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    ps>dir /s /q

     but  OPTION "/s /q"cannot use ,many cmd.exe :"option",like   ipconfig /displaydns cannot use

    ipconfig [/all] [/renew [Adapter]] [/release [Adapter]] [/flushdns] [/displaydns] [/registerdns] [/showclassid Adapter] [/setclassid Adapter [ClassID]]


Answers

  • Wednesday, November 04, 2009 10:43 AMVadims PodansMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    cmd /c "dir /s /q"

    > like   ipconfig /displaydns cannot use

    this incorrect. You can use all options for ipconfig.exe in PowerShell console. First wxample doesn't work because actually DIR is alias for Get-ChildItem, therefore you need to wrap this command to cmd /c.
    http://www.sysadmins.lv

All Replies

  • Wednesday, November 04, 2009 10:43 AMVadims PodansMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    cmd /c "dir /s /q"

    > like   ipconfig /displaydns cannot use

    this incorrect. You can use all options for ipconfig.exe in PowerShell console. First wxample doesn't work because actually DIR is alias for Get-ChildItem, therefore you need to wrap this command to cmd /c.
    http://www.sysadmins.lv
  • Wednesday, November 04, 2009 10:55 AM李连杰 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    thank you!