4 ms·
You should take a serious look at using powershell, they've aliased a lot of commands to what you expect on linux so you're not completely foreign and it's got
by Already__Taken 12y ago
You should take a serious look at using powershell, they've aliased a lot of commands to what you expect on linux so you're not completely foreign and it's got a similar workflow mentality you're used to i.e pipe commands.
And you can work with .NET natively.
That said it is NOT to imitate linux, it's conceptually not the same which is good because Windows isn't either.
Here's a 101; commands are `verb-noun -parameter value` these pipe | objects(!) not strings. The first thing you should do is win+R powershell type: get-alias and after that `get-help ls` just drop in powershell wherever you used to calling cmd and see how it goes.
- ygra 12y agoAnother word of advice: Try to use the pipeline as much as possible. Passing objects through the pipeline is a core concept of PowerShell for a reason. Don't try writing C# with PowerShell syntax (as I see so many people do on Stack Overflow). Some answers I have written on SO that exemplify that: • http://stackoverflow.com/a/7394766/73070 http://stackoverflow.com/a/7394766/73070 • http://stackoverflow.com/a/1046291/73070 http://stackoverflow.com/a/1046291/73070 • http://stackoverflow.com/a/14481495/73070 http://stackoverflow.com/a/14481495/73070
- doorhammer 12y agoI just glanced at the top post you have linked here (I'll definitely take a look at the others later). At first glance it reminds me of unix pipes, clojure's thrush operator, and F#'s pipe forward operator. (they're all different from one another, of course, but the general idea of threading data through pipes/filter/transformations to get what you want) If I'm not totally missing the mark there, and that's the idiomatic way to do things, I'm glad. I really prefer dealing with scripting/command line stuff that way. Really appreciate the information!
- joelthelion 12y agoPowershell is a great language. I would love to see unix shells inspired by it. The associated toolset, on the other hand, is clearly not there yet. As soon as you start doing real things with PowerShell, you will hit all sorts of bugs and limitations. Your mileage may vary, of course.
- Already__Taken 12y agoRemoting and signing has been a nightmare to set up on my domain but otherwise so far I'm still having a pleasant experience. Obviously the console itself is the same as cmd's which is terrible. I just work a lot with the ISE open but still looking for a slicker terminal. I've been able to just deploy PS v4.0 across all of my computers I think a lot of the headache comes from trying to use new stuff and seeing windows 7 ship with v2.0 I'm curious what kind of things you're running into, I'm getting quite immersed in using PS all over.
- joelthelion 12y agoWell, what you said, crappy console, no ssh (the powershell equivalent is just not very good), but also, no grep (findstr is not a good substitute), no rsync, etc. Whatever I've attempted I've always hit unexpected walls due to the unavailability of tools we take for granted with linux.
- Already__Taken 12y agoI'll parrot one of the PS developers; "grep, sed and awk etc are really great on nix because they're great with text, they're text based operating systems and you can do anything with them. Windows is an API based system so just moving text around doesn't get you very far." There's a mountain of filters available in the cmdlets parameters but specifically since you mentioned grep. findstr is not powershell it's in the old cmd family of programs still in your PATH. You want to look at select-string http://technet.microsoft.com/en-us/library/hh849903.aspx http://technet.microsoft.com/en-us/library/hh849903.aspx I wish MS would include SSH but the party line is they've no idea who really wrote the code and they won't include it in windows in case they get sued over it.