Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I switch from CMD.exe to Powershell? [closed]

I have this idea that I should switch over from cmd.exe to powershell. It's so much more powerful than the tried and tested cmd.exe. It is the shell of the future for Windows.

But my facility in powershell is so limited, in comparison with cmd.exe. Around every corner I discover another seemingly small obstacle that is insurmountable.

Today I tried to ctrl-C to stop a running program, inside a powershell, and it had no effect. ??
Last time through it was "how to do a 'dir /o' in powershell?" I know how to do for loops in .cmd scripts, how do I do that in powershell?

I need some advice: First, is it a good idea to try to switch to powershell?

If so, question 2 is: what are your recommendations on how to break the cmd.exe habit?

  • Should I just post every question to Stackoverflow?
  • Should I dedicate a full day to learning powershell? is there a training course I can take?
  • is there a good cookbook of common powershell recipes? a powershell wiki I can ingest?
like image 910
Cheeso Avatar asked May 15 '09 12:05

Cheeso


People also ask

How do I change back to PowerShell from CMD?

How do i switch back to Command Prompt instead of Powershell ? Settings > Personalization > Taskbar switch off replace Command Prompt with PowerShell.

How do I open PowerShell instead of Command Prompt?

For those who prefer using Command Prompt, you can opt out of the Windows Logo Key + X change by opening Settings > Personalization > Taskbar, and turning off, Replace Command Prompt with Windows PowerShell in the menu when I right-click the start button or press Windows key+X.

How do I change open to in PowerShell?

In the Taskbar and Start Menu Properties window, go to the Navigation tab and uncheck the Replace Command Prompt with Windows PowerShell option. Click Apply for the change to take effect.

How do I exit CMD?

To close or exit the Windows command line window, also referred to as command or cmd mode or DOS mode, type exit and press Enter . The exit command can also be placed in a batch file. Alternatively, if the window is not fullscreen, you can click the X close button in the top-right corner of the window.


2 Answers

  • Perhaps this Powershell Cheat Sheat can help you. (there are PDF's if you scroll down)
  • There is also this Mini Wiki entry [broken link] on Powershell
  • Translating from CMD to Powershell
  • Powershell Cheat Sheet
  • Top 10 Tips for using Powershell (scroll down a bit)
like image 63
Ólafur Waage Avatar answered Oct 15 '22 10:10

Ólafur Waage


To help ease the transition, remember you can always run the original DOS commands by prefixing any command with "cmd /c". E.g.

cmd /c dir /s
cmd /c start .

There are, of course, PowerShell equvialents, but this trick will help you stay productive with what you know while learning PowerShell.

like image 38
Peter Seale Avatar answered Oct 15 '22 09:10

Peter Seale