Ask Slashdot: Moving From *nix To Windows Automation? 427
Zubinix writes "I have a background in doing automation in a Unix/Linux environment using scripting languages such as perl and bash shell, as well as ssh for remote scripting. My next project will be in the Windows environment so what approach and methodology is best for developing, say, the automation required for a test system? I don't want to use things like Cygwin, as I need to integrate with Windows applications such as Exchange and Sharepoint. Is there a list of should and should not dos when it comes to Windows automation?"
Powershell (Score:3, Insightful)
Lets look at the situation (Score:1, Insightful)
Lets look at the situation. You have the Unix shell (C, Korn, Bourne, Bash, etc), designed over long periods to offer universal functionality and complete environmental control. You can control processes in detail. You can integrate seamlessly and universally with every application on the box, and are given more control and more options than the graphical user interface. The shell scripting languages offer logic and control structures consistent with Turing Complete languages. There is nothing equivalent, or even close in the windows world. There are some 3rd party applications that may attempt to do scripting, but they are all after the fact. Windows was never designed as a 'back end' system. Their offerings offer limited functionality, since its all after the fact. Part of the issue is that its almost universal that every application that has a graphical user interface in Linux or Unix, also has a non-graphical interface integrated and designed as part of the application. Many windows applications don't have that functionality (all user control over the application is graphical, all output is graphical, except to very specific parts areas of the operating system, there is rarely any back-end command and control that a scripting language can do anything with). Shorter answer: you are going from a richly endowed system to a very sparse one. You are already in trouble.
Re:Bad luck (Score:2, Insightful)
It's hard to bash Windows (enough) (Score:1, Insightful)
Re:Don't do it... (Score:4, Insightful)
Re:Don't do it... (Score:4, Insightful)
Those cli utilities are 30 plus years old. Any sysadmin worth his salt will know them inside and out. How is the syntax any more arcane than what is spit out by ps? And, er, last I checked the ease with which completely unrelated utilities can be chained is the point!
"Arcane" is a term that is only ever used to describe a non-Microsoft OS, sort of like the way the word "upstate" is only ever used to describe a region of the state of New York.
It is shorthand for "I don't know anything about it, therefore something is wrong with it."
Re:Don't do it... (Score:4, Insightful)
Let me know when it's as ubiquitous as bash or csh. As far as I know, it's only pre-installed on Windows Server 2008 or greater.
Okay. It's as ubiquitous as bash or csh. It ships out of the box with Windows Vista, 7, Server 2008 and 2008 R2, and for XP it is included in Windows Update so any computer properly receiving it's updates will have it.
Re:Powershell is a Winner (Score:4, Insightful)
bash...
Probably the hardest thing to learn in the *nix scripting world is sed.
I wrote a menuing system for a Xenix minicomputer back in the early 1990s in straight sh, never having touched it or the Unix tool set before, in a couple of hours. And I can tell you I ain't no genius.
Try do anything vaguely useful in Powershell without prior knowledge in a couple of hours. It is a gawdawful horror story, a good example of the insane overkill that Microsoft applies to simple problems. It keeps the MCSE's employed with the bizarre range of esoteric and overly-complicated solutions, but when you're just trying to move some data around from tool to tool or piping some output through a regex evaluator on its way to a SQL RDBMS, you end up going "What the fuck is wrong with those people in Redmond?"
Re:Perl, ReXX? (Score:4, Insightful)
When in Rome, do as the Romans do.
He was asking about Windows server administration, and PowerShell is the right way to do that.
For most new Microsoft server products, the script bindings are only available for PowerShell (in the form of snapins or modules). Many third-party vendors are releasing products that are PowerShell only. It is also the only shell that can call all mainstream APIs (COM, WMI, WinRM, and .NET).
Perl specifically is one of the worst possible options for Windows scripting. It is a text processing scripting language designed for Linux, where most applications and even system APIs are text based. Windows mostly uses object-oriented binary APIs. Very few Microsoft server products have text-based command-line tools that could be automated with Perl.
Suggesting Perl for Windows automation is a bit like trying to script Linux with VBScript. Does that sound like a good idea to you?
Re:Don't do it... (Score:5, Insightful)
The point was the grandstanding, the comment "I do have to say Powershell is pretty sweet" implied something interesting or insightful was going on.
There is. PowerShell is a refreshing new take on shell scripting. Granted, it is best fit for Windows because Windows is already pretty much object oriented from a system point of view. But at the same time traditional shells would struggle with incorporating OO concepts. PowerShell does away with the need for sed and awk, has a built-in extremely powerful regex engine and has modern constructs like structured exceptions, script blocks, closures, integrated help (no not just man pages) and a lot of other interesting stuff like the common -whatif and -confirm parameters, remote sessions and remote jobs, fan-out remoting etc.
You may not like the fact that Windows now sports a shell which surpasses bash, ksh and zsh in many ways, but that doesn't mean that it is not interesting. It is for a good many of us.
Half of the people in this thread make it sound like this is such a big deal, and it's still a pile of steaming crap.
Yeah, whatever. You are entitled to your opinion. But please educate yourself on the subject.
It's like I've stumbled into some bizarro-world edition of Slashdot where getting a limited command shell to function under Windows is some sort of nirvana. You still have a (very very very) limited shell with little of the functionality of shells created 20+ years ago.
Translation: "Help, someone in here has something good to say about Windows and nobody helps me with bashing them. Anything coming from Windows cannot possibly bring anything new. I refuse to look at it. If it is any good, it must have existed for 20+ years in Unix".
Grow up, please. PowerShell is a full-featured command shell and surpasses bash, ksh and zsh in several areas. You may still prefer *sh shells, but on Windows there is an interesting new take on the concept.
Or, to put it simply, "there is nothing to see here". What you think of as the Rapture is a meh moment at best.
Translation: "I don't want to hear about anything which could challenge what I already know as the truth."