Friday, October 21, 2011

How to run Powershell commands in “cmd”


Hi,
Sometime you want  to run PowerShell commands in Batch (.bat) files or may be from old command shell (cmd.exe) due to some specific needs or you may want to replace your old dos based email program with “ Send-MailMessage” , and you was thinking how to do it , let me show to you :)

comand prompt
So let’s Do it !!!!!
Step.1
Open “Command Prompt”
  • Go to “RUN” {Windows Key + R }
  • Type “CMD”
  • RUN Box
  • Now on “Command Prompt” type “Powershell.exe <cmdlet Name>”
    • For Example: “PowerShell.exe Get-Process”
Bingo!!!!!!!
It’s working perfectly J

Thanks
Aman Dhally

No comments:

Post a Comment