views:

772

answers:

6

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?
+12  A: 
Ólafur Waage
+1  A: 

It just seem isurmountable when you start stick with it.

in Powershell the key combo for critcal stop is Ctrl + Break

Ir terms of sorting there is a Sort-Object commandlet so you can sort by any property.

So you can call Get-ListItems | Sort-Object. Its worth trying to learn the commandlet names rather than the alias its associted to.

If all else fails ask here theres always a lot of knoweldge to go around.

Saint Gerbil
+6  A: 

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.

Peter Seale
THAT is very helpful.
Cheeso
+2  A: 

I'd suggest reading Windows Powershell in Action. And then just do everything you can in powershell.

Orihara
+3  A: 

I've been in the same situation. What I finally did was close my CMD window that was normally open all day and keep the PowerShell window and force myself to only use it.

I only resorted to CMD when something was urgent and I didn't feel I could take the time to figure it out in PS.

I'm still not quite as proficient in PS yet, but I'm getting better everyday.

Below are a couple good books and some links to some good resources.

I liked these two books a lot:

Also, check out these sites:

aphoria
+1  A: 

I second the recommendation to read Windows PowerShell in Action. If however, you don't want to part with that much $$ just yet, check out this free eBook I put together: Effective PowerShell. Also, do give PowerShell some time. I think it will pay off in spades on the backend.

Keith Hill