Microsoft Releases PowerShell DSC For Linux 265
jones_supa writes: Microsoft is announcing that PowerShell Desired State Configuration (DSC) for Linux is available for download in form of RPM and DEB packages. DSC is a new management platform that provides a set of PowerShell extensions that you can use to declaratively specify how you want your software environment to be configured. You can now use the DSC platform to manage the configuration of both Windows and Linux workloads with the PowerShell interface. Microsoft says that bringing DSC to Linux is another step in the company's "broader commitment to common management of heterogeneous assets in your datacenter or the public cloud." Adds reader benjymouse: DSC is in the same space as Chef and Puppet (and others); but unlike those, Microsofts attempts to build a platform/infrastructure based on industry standards like OMI to allow DSC to configure and control both Windows, Linux and other OSes as well as network equipment like switches, etc.
"Open" Standard (Score:5, Insightful)
It is a lot easier to embrace an "open standard" when you developed it yourself, then donated it to a consortium.
http://en.wikipedia.org/wiki/O... [wikipedia.org]
CIM is really a widely adopted open standard (Score:3)
WBEM [wikipedia.org] is a decades old open standard implemented by just about every major software and hardware manufacturer out there. It's shipped with just about every OS. The computer you are using right now probably has CIM implementation built in or at least available in the core OS.
The standard is managed by the Distributed Management Task Force [dmtf.org] which includes most top software firms. Here is the Java
Powershell is possibly the worst shell ever (Score:4, Insightful)
Powershell is a shell written by programmers who have no understanding of what you want when administering a box. I remember when it surprised me the first time by being clever and inheriting the size of the console and automatically inserting a CR/LF into the lines of the files I was trying to process.... morons. Just because you can do something doesn't mean that you should, yes OO is a powerful construct but it just gets in the way of a simple scripting tool. Powershell is littered with little gems like this that make it absolutely useless. If you find yourself doing too much with a shell script rewrite it in a more powerful programming language like python, it should take you all of 30 minutes.
Powershell is sweet as hell (Score:2, Interesting)
Instead of trying to unreliably and painfully get out the data you want with a chain of cut, sed, awk, tr on a untyped text string etc you can just get what you want from a object.
All Unix shells are text-oriented. PowerShell is unique in that it is object-oriented and represents a big leap and innovation in shells.
Re: (Score:2, Troll)
Unfortunately the leap is backwards.
I don't think I've had to use cut sed awk or tr in more than a decade none of those are really for day to day sysadmin work. If I want well defined objects I use SNMP you know an extendable standard that has been around forever with a functional and extremely fine grained security model. Newer kit tends to some sort of rest API, XML is similar in structure to SNMP it's just it's overly verbose bastard child. Most of the stuff I used to use bits like awk for are log pro
Re: (Score:2)
This is another round of the same thing WMI is, a bad replacement for a standard method.
Thank goodness there are other voices out there calling out WMI (and by extension CIM/WBEM) for the crapfest it is.
Not all rosy... (Score:2)
Powershell works that way because MS controlled the development of the vast majority of components that normal people interact with. It delivers a framework to let third parties do it 'the right way', but there's a lot of missing stuff and when you interact with the few CLI friendly executables that existed, you are right back there.
Basically, you could use 'python' as a shell and have the same benefits, complete with the awkwardness of interacting with non-python executables. In MS world, this is less di
Re: (Score:2)
Except that you end up turning those objects into text anyways in a large majority of scripts, making the "object" innovation little more than an annoying gimmick.
Re: (Score:3)
Powershell is a shell written by programmers who have no understanding of what you want when administering a box.
Argumentum ad systemd.
Wow. (Score:4, Insightful)
What the hell kind of sadist is going to manage their machines from a Linux machine running PowerShell?
"Unsupported configuration" is the first hurdle that I'd foresee, followed by just being plain, unnecessarily painful.
Re: (Score:3)
This is for those shops that do everything in Visual Studio, host their stuff on Azure, and have that one or two pesky Linux box for a solution they just couldn't kluge together on Windows.
Now they can manage those boxes with the rest of their environment.
This isn't a solution for you or me, but in a Microsoft-centric shop, this might be exactly what they are looking for so that they don't have to throw out all their management in a wholesale replacement.
Looks interesting but I am wary... (Score:5, Interesting)
What does powershell has that python or perl does not have?
Re: (Score:2)
one time an employer made me choose windows or Mac. Linux was verbotten.
i got windows, installed putty... and that's about it.
Re: (Score:2, Insightful)
But if I am going to learn something new, what advantages this powershell has that python does not? Cygwin + bash is cross platform enough for me to switch between ssh windows in linux boxes and my windows desktop.
Desired State Configuration (DSC) that FTFA was about, is definitely one such thing that PowerShell has that python has not. DSC is a *declarative* description of the configuration you want for a target system. You should think more in line of Chef or Puppet than Python. PowerShell DSC for Linux actually *uses* Python.
The idea is that you use PowerShell to define a data structure (much like a Ruby hash) that describes the configuration of the node. DSC will itself resolve dependencies. If you require a feat
Re: (Score:3)
So this is just a sys-admin tool. Not a general purpose scripting language.
It is a general purpose scripting language.
An object-oriented general purpose scripting language with a number of features that makes system administration easier.
One example is DSC. It is a scripting language that can use the DSC *platform* to make sure that target systems are all configured the same way, albeit each with different parameters.
Another example is workflows. Wake me up when bash or python can start a script that can survive system restarts and pick up and continue from where it was when the s
I have a wish :) (Score:4, Funny)
At this rate, we'll see MS commit stuff to Wine not long before Christmas.
I'll start a collection for all the tormented souls in Hell, as they'll need lots and lots of warm clothing as the ice age dawns upon them.
Security (Score:2)
Admitting defeat (Score:2)
Nice.
This is just a problem waiting to happen (Score:5, Interesting)
I only see this causing issues.
1) Windows Admins writing power shell scripts to do stuff on linux boxes
a) setting permissions to 777 because they got in the way.
b) why will it not write the file to c:\?
c) A power shell script developed and tested on Windows, then pushed out to all the servers and crashing the Linux boxes.
c) Do you really believe that a Linux admin would allow a windows Admin to run a Power Shell script as root?
2) Linux Admins being asked to manage windows servers because "You know Power Shell" (If they can get the Linux admin to manage the 300 windows servers on top of the existing 500 Linux servers he manages, it saves them headcount and $$$)
Personally I see it going the way all the other Microsoft products have gone when they release a Linux version. It gets adopted by a few windows admins that are forced to work on linux. However the Linux admins and the bulk of Linux systems will never see it or use it. It will eventually get dropped because of the bugs, memory leaks, and issues that are found in it. Those that are never fixed because they concentrate on the Windows version and ignore the Linux version.
Judging from history it is another Embrace, Extend, Extinguish attempt. Microsoft is just pulling from it's old bag of tricks.
Re: (Score:3)
Microsoft is running up against 40+ years of Bourne shell and its descendants. I doubt even Microsoft could really hope to defeat that kind of legacy.
Well there is a bigger issue... (Score:3)
Other organizations have tried and failed to do this sort of thing, simply because they are superimposing their own stuff on top of the stuff that really does the work. So you either have the code complexity of code managing the tooling that is really doing the work, or the code managing the work, doing the work, and some middleware that doesn't add meaningful value, but does add complexity. Having translation layers rarely does nice things for maintenance and stability, regardless of who is doing it and
Re: (Score:2)
Re: (Score:2)
Your #1 scenario hinges on the Windows admins in question being illiterate morons, having just sat at a computer for the first time that morning.
Your #2 scenario hinges on the Linux admin being too stupid to pick up cross-pollinated skills.
I find both of these scenarios unlikely.
Judging from history it is another Embrace, Extend, Extinguish attempt. Microsoft is just pulling from it's old bag of tricks.
Extinguish what? Their own Powershell? Wouldn't deleting the source repository be faster and cheaper?
'based on industry standards like OMI' (Score:2)
This is pretty misleading. OMI is Microsoft's pet 'standard'. They know the politics of DMTF to get things the 'standard' rubber stamp, but it has no bearing on actual applicability to the general environment. Basically going OMI means a pretty crappy set of flaky abstraction/instrumentation has to be put on the target that doesn't actually provide any more value than the open source competitors. CIM/WBEM has long languished for lack of anyone wanting to do it, and MS is trying to force the issue by doi
History (Score:2)
I hate and mistrust Microsoft as much as the next guy, but let me say this:
* Mathematics is powerful because you take two numbers and an operator and as a result you get something that you can re-use in the same fashion
* Unix is powerful because you take text files and an operator and as a result you get something that you can re-use in the same fashion
* Relational DBMSs are powerful because you take two relations and an operator and as a result you get something that you can re-use in the same fashion
* Mon
Next step (Score:2)
First : Office on a Linux Variant (Android)
Second : Code Text Editor
Third : PowerShell tools
(...)
[last step] Abandon the costly development of the unsecure and buggy Windows OS and use only some new library à la Wine and a Windows-like graphics shell on a Linux Base OS
(more profit less cost)
I wonder if this integrates with SCCM (Score:3)
Part of SCCM is the DSC for Windows servers. What this allows is to validate (ie. scan) for changes to the default build for servers, desktops, and provides integrated reporting. While there are many tools to do this, it is free from MS (minus the OS and SQL DB). If adding Linux to this is a possibility, having your compliance and reporting in one tool, which can leave you from having to run tripwire enterprise or the like due to compliance requirements, might be a win.
I am not saying it is the best thing on the planet, but if it does what the theory states, that would be a huge deal to have 1 less tool to manage to provide compliance reports.
Henry Spencer said (Score:4, Insightful)
"Those who don't understand UNIX are condemned to reinvent it, poorly."
Re:I'll bite (Score:5, Interesting)
PowerShell is a modern shell.
Benefits: .NET Framework
- Object oriented, so no awkward parsing of strings. Every item is automatically delivered in its own capsule.
- Integration with other Windows subsystems and the
- Comes with a mini IDE called PowerShell ISE for developing scripts
- Excellent documentation with lots of examples (the Get-Help command)
- Intuitive, easy to remember command names
Re: (Score:3, Interesting)
Every time I have used powershell it has been anything but intuitive or easy to remember.
Re:I'll bite (Score:5, Informative)
It sounds like you dont use it often, which is hardly a good reason to knock it. But I can offer a few tips:
1) Remember that just about everything is an object, with one or more attributes and methods. Even strings are objects, and can use methods such as ".equals(System.obj)". Get-Member is your friend for determining what methods and attributes apply:
"This is a string" | get-member
2) All (properly made) commands take the form of [verb]-[noun]:
get-member
set-ADUser
remove-item
get-help
3) When iterating over a group using "foreach" or "where-object", the special variable $_ is used as a placeholder for the current element:
@("arrayIndex1", "arrayIndex2") | foreach { write-host $_ }
@("RedFish", "BlueFish", "BlueBird") | where-object {$_ -like "blue*"}
4) When in doubt, use one of the following:
Get-Help [command]
Get-Command
$variable | get-member
$variable | format-list *
Im of the opinion that it takes all of about 8 hours to learn to do the majority of things you would want to do in powershell (partly because thats about how long it took me). You just have to take some time to sit down and learn it, and then make an effort to use it instead of GUI administration tools. It is far, far superior to old windows command prompt and vbs,
Re:I'll bite (Score:5, Insightful)
Im of the opinion that it takes all of about 8 hours to learn to do the majority of things you would want to do in powershell (partly because thats about how long it took me). You just have to take some time to sit down and learn it, and then make an effort to use it instead of GUI administration tools. It is far, far superior to old windows command prompt and vbs,
I think the same can be said about any *nix shell. Having used powershell a few times, it really just feels like a kludged attempt to bring CMD.exe to something closer to bash.... 20 years later. Now the question becomes just because you can use it, does it mean you should? Last I checked, Windows still has a lot of protections from even the simplest modifications. I much prefer being able to see /etc/fstab than working with some nebulous class with functions that barely make sense.
Re:I'll bite (Score:4, Insightful)
I think the same can be said about any *nix shell
Clearly you've not done much UNIX shell scripting, if you've not been bitten by the issues with having to escape strings multiple times.
Re: (Score:3)
Re:I'll bite (Score:5, Informative)
The nix shells I have used are very powerful, but also very, very painful to learn. Learning sed / awk syntax could easily fill 4 of those 8 hours I mentioned; and thats not even getting into how each and every tool has its own unique idea of how to do syntax. What does a -z switch specify? I dont know, probably fire up that man page and dig through it. What about -h? Is that help, or human readable?
it really just feels like a kludged attempt to bring CMD.exe to something closer to bash.
Theyre not even remotely close. They both operate on the idea that data should be passable between consecutive commands via a pipeline, but bash makes no attempt to deal with different types of data nor any good way to determine what data is incoming. Powershell solves this by being object oriented, and letting you easily determine the type of data coming in, export it to XML, and reimport it at a later session if desired.
As an example-- if you have an error in bash, whats the stack trace look like? Do you have a good way of capturing it? In powershell you can reference the $error[0] variable, and pull up any piece of info you might need to troubleshoot, or even just export the whole thing by "$error | export-cliXML -file C:\somefile.xml" if you're running a nightly job; any issues can later be imported into a new session to diagnose.
Now the question becomes just because you can use it, does it mean you should?
Yes. If you deal with IT infrastructure at all, you would be absolutely crazy not to learn it; its explicitly supported (with native commands) by:
* ALL of the major virtual infrastructure providers (VMWare, HyperV, Xen
* All versions of windows
* A great many storage providers (EMC, NetApp, probably others)
* A number of network infrastructure providers
* IIS, and Exchange -- like it or not these are huge players
* And anything else you want to add support for yourself-- I note that Hadoop for example has community support for powershell
By support, I dont mean in the sense that you could use bash to launch SSH to manage these things. I mean in the sense that VMWare allows you to run the following native powershell commands:
Connect-VIServer myVMCluster
Get-VM | Where-object {$_.powerState -eq "PoweredOn"} | foreach { stop-VM $_}
And all of your VMs will be shut off. Trying to do something like that in bash is doable, it just requires screwing around with scripted SSH access to the VMhosts which is painful, for anyone who has done it.
I much prefer being able to see /etc/fstab than working with some nebulous class with functions that barely make sense.
This is a criticism of object-oriented languages, not powershell. You might as well rail against .Net, or Java, or C++.
Know Microsoft, Know Pain (Score:2)
This is a workaround to enable (ancient) management methods to be effective in an environment that *many* people have already abandoned.
Massive, heterogeneous, "Enterprisey" deployments benefit from far more complete tools than fucking PowerShell, and nobody I want to work with wants wholesale management of *any part of the thing* through a proprietary black box.
Re: (Score:2)
Massive, heterogeneous, "Enterprisey" deployments benefit from far more complete tools than fucking PowerShell,
I mean its not like PowerCLI is a thing required for the creation of AutoDeploy profiles for VMware, or like thats a major feature for using stateless hosts on datacenter-scale clusters. Its not like Storage arrays commonly require SSH to configure, but offer powershell as an alternative.
Reading your post, I get the impression that you think that network switches, routers, and SANs are configurable via some webpage. I can promise you, when that is the case, its an awful experience. Generally "enterprisey
Re: (Score:2)
Systemd will fix that soon enough.
Re: (Score:2)
It's not really fair to say that Powershell is, "a kludged attempt to bring CMD.exe to something closer to bash.... 20 years later." You can argue that it's kludged (I don't think it really is) or that it's late to the game (it is), but it's not really like Bash. Bash treats everything like text, whereas Powershell treats everything as an object. Bash relies on a lot of stand-alone applications being chained together, whereas Powershell tends to have more built-in functionality which is supplemented by v
Re: (Score:2)
Those examples are wrong.
GNU/Linux copy command: cp
Powershell: cp
GNU/Linux delete command: rm
Powershell: rm
Re: (Score:2)
Every time I have used powershell it has been anything but intuitive or easy to remember.
Once you get used to the naming system then it is quite intuitive. And if you don't know how to do something then it has some built-in mechanisms to make it easy to find out how to do things. For example, if you don't know how to import a CSV file, try get-help *csv* and it shows all the aliases and commandlets and pertain to CSV importing and exporting.
Then with tab completion you can Import-Csv - and press tab after the dash and view all the parameters of the command. If you choose -Encoding press space t
Re: (Score:3, Insightful)
No. A shell that has an IDE to aid formulating godforsaken scripts that mere mortals can't even remember. Just no.
Re: (Score:2)
Indeed. When it gets complicated enough that an IDE is beneficial, I go Perl or Python. (And I still do not use an IDE for those. IDEs are crutches for beginners.) Shell is for simple-clear-fast(to do) only.
Re: (Score:2)
IDEs are crutches for beginners.
I'm always surprised that this old-school condescension still exists today. An IDE is a tool. Sometimes it's the right too for the job and sometimes it isn't. Not using one doesn't make you a leet haxor.
Re: (Score:2)
You misunderstand. I find that IDEs stand in my way and make me slower. They also make it harder to concentrate on the core of the problem. I am not declining to use them on principle. In fact, I try one from time to time when I learn something new (last one was the Python IDE), but so far I have always dropped them pretty soon because they were not very useful. The only thing I dropped really fast was that hacked-together atrocity Eclipse, when I found that a) it was hard to use my own text-editor and b) t
Re:I'll bite (Score:5, Insightful)
Have you ever seen init scripts? Theyre way more painful to deal with than anything powershell ever is.
The reason they have an IDE for it is because you can use it to do incredibly complex things, like design GUIs that tie in administration elements from Active Directory, SANs, switch configuration, virtual infrastructure configuration and deployment, and computer administration-- all in one language with a common syntax.
Doing something like that would be a nightmare in bash. It sounds like you havent used powershell, which is a pretty good reason not to comment on it.
Re: (Score:2)
Why would you want to do that with a scripting language ? I thought that's what MMC was for.
While nice sed tetris isn't a good idea either.
Re: (Score:2)
An MMC would not allow you to use a text-field to search for a user, press a button, and have a new VDI instance spun up, storage provisioned, and permissions configured.
A more common use case would be what I described, but without the GUI, repeated 100 times for 100 different users.
Re:I'll bite (Score:5, Informative)
I've used Powershell several times to write more complex scripts that I would normally have installed Perl on a Win64 system to handle but didn't want to in those particular cases. It worked pretty well once I got all the permission issues worked out, and got kind of familiar with the syntax.
It was still extremely painful to use. The bloody verbosity of the platform (it really is a platform - not a language) was the worst part. It seems to have been engineered straight out of the com-sci-professor-that's-never-had-to-build-anything's handbook. There is no compromise for anything, few shortcuts. The functions were not sensible in my opinion, as some other posters have mentioned, they would use terms that simply had more syllables than obvious synonyms that are normally used for such things. An IDE was necessary so you could scroll through the list of available functions to find the one you were looking for as they were generally not that obvious. Once you get used to them, sure, it's not as bad, but it's still like having an ankle hobbled compared to both knees.
I would say it's fantastic compared to your standard batch script. If that's all you've ever known, I seriously pity you.
I would also say it needs to compromise a great deal to be reasonably useful to people building system scripts, especially coming from unix environments where we've had such tools for $AGES, and have always been asking why our Windows brethren would put up with such silly useless systems.
I would say that the above you say would be a nightmare in bash - it would be much more trivial in perl, which is what I commonly use for such things. A quick for loop to rename files? Definitely bash. Holy cow is that a pain in Powershell.
Lastly, I would say: man pages. Sure, MSDN, but not when you don't have network access, or were you cool with installing 1.7gb more files (seriously??) to support it? Space is cheap until you are running out, at which point it's immediately more expensive. It's just a no-brainer.
Overall, I think Microsoft is incredibly late to this game, over-engineered something as is the norm, and is using marketing tactics to heighten its adoption rather than working on its usefulness. If they could drop in better in-line documentation especially at the command-line (GUIs are great when you have plenty of monitor space and are actually using a UI instead of the console, when you really need to be confident in what that switch is about to do to your last snapshot), make a lot of aliases for the functions (not just the objects) they've developed for the various classes available, and make many of the more commonly used functions statically available directly in the shell instead of buried deep down in some class infrastructure, I for one would be tossing all of my Windows Perl installs (sorry ActiveState, but they're really just band-aids!).
Re:I'll bite (Score:5, Informative)
The bloody verbosity of the platform (it really is a platform - not a language) was the worst part
A few things-- the language has a large number of shortcuts, like "fl" instead of "format-list" or "?" instead of "where-object" or "%" instead of "foreach". But the verbosity of it is not really a bad thing, as it makes the resulting code at least somewhat self-documenting; its crystal clear what each command will do most of the time.
An IDE was necessary so you could scroll through the list of available functions to find the one you were looking for as they were generally not that obvious
This is what tab-completion or get-member or even "get-help [command] -examples" is for.
A quick for loop to rename files? Definitely bash. Holy cow is that a pain in Powershell.
$date = get-date -format yyyyMMdd
get-childitem -filter *.txt | foreach {rename-item $_.fullname "$date_$($_.name)"}
Really not that painful.
You mention usefulness- the usefulness as you said is that its a platform supported by an incredible number of vendors. Just about every piece of infrastructure I've come across has vendor-provided powershell integration; the ability to take output from a get-VM command and pass it into a storage provisioning command makes a number of tasks incredibly easy.
Lastly, I would say: man pages.
get-help is your friend, and is far superior to man with the -detailed or -examples switches. Not sure where you're getting the "1.7GB", but this page [microsoft.com] indicates that the size is more like 9KB.
Take a look at Windows' initialization system (Score:2)
Oh, that's right. You can't. It's not a PowerShell script.
Re: (Score:2)
I'm still trying to get over the upgrade to systemd, you insensitive clod!
Re: (Score:2)
No. A shell that has an IDE to aid formulating godforsaken scripts that mere mortals can't even remember.
What about an IDE for formulating normal scripts that mere mortals can even remember?
I don't see what the objection to an IDE is. If I'm writing anything more than the simplest script, I find it helpful to have some kind of debugging tools.
Re: (Score:2)
You can't tell me that it wouldn't be a tiny bit practical to have an IDE help you with the syntactic fun of bash in these cases.
That would require admitting that all is not right in paradise - something an ideologue could never do.
Re: (Score:2)
Re: (Score:2)
doesn't work.
while: x=3 does.
The l, r-value and assignment operator can not be tokenized by whitespace.
Re: (Score:2)
Because there's no such thing as an assignment operator in bash. Everything is a string token at first (even numbers aren't number unless you're in arithmetic evaluation context), and then tokens get interpreted in various ways once split by whitespace.
x = 3 happens to be three tokens, the first one being the command 'x', the other two being parameters '=' and '3' to command 'x'.
x=3 is one token and it doesn't mean assignment unless it's in the command preface where assignments take place.
This is from 'man
Re: (Score:2)
Tomatoe Toma
Re: (Score:2)
Having an IDE for scripts isn't necessarily a bad thing. Scripts are often complicated beasts.
bash has a heck of a lot of builtins, and then there are external executables. Remembering the commands, the syntax, and so forth for all of this can be quite challenging.
Just to take a very simple example. For the sake of this post, I was going to say "assign a variable a different variable + 1". So, I tried doing that in bash.
x=3 y=$(x+1)
Oh, right, I need another $
x=3 y=$($x+1)
Hmm. no. Right. Double parenthesis in this case.
[snipped]
done file
You can't tell me that it wouldn't be a tiny bit practical to have an IDE help you with the syntactic fun of bash in these cases.
I can tell you that you're doing it wrong - what's wrong with bc? And yet, $() vs $(()) is dead simple to remember, so simple that I hardly use bc. It's not just the bash shell that's powerful, it's all the utilities that go with it - cut, sed, grep, etc. It's the fact that the less trivial logic can be written in python, perl, hell even some other compiled program.
The value of bash is ironically not bash itself, it's the ability to use some third-party program, which was never designed for anything other t
bc isn't installed (Score:2)
Why do I need another utility when I can just use the proper syntax?
Re: I'll bite (Score:3, Insightful)
Why the hell did they put the verb first in command names? They're all Get-This or Set-That or Export-Those or Write-These. This makes an alphabetic list of commands useless, because it groups by verb instead of by noun. It's just one long list of Get- commands, for example, that then need to be searched to find the relevant noun. They should have put the noun first.
Re: (Score:2)
1. What is awkward with string parsing? Is this shell aimed at _incompetent_ people?
2. And that works how on Linux?
3. An IDE in a Shell? Is the syntax so bad that you need an IDE? Or is this another effect of being aimed at incompetents?
4. Aehm, know any mainstream modern shell that does _not_ have excellent documentation?
5. Seriously? I found the command syntax exceptionally awkward and badly thought out. I am back to a cygwin console for most things.
Re: (Score:2)
Hopefully it's MS's attempt to either get real developers to use it and justify its cost, or to ignore it and maybe finally get BASH in windows so it can stop sucking so much.
Re: (Score:2)
They will not get bash to work well under windows. The problem is the brain-dead and overcomplicated NTFS permission system. There is no way to get that handled without just as over-complicated and brain-dead "special" tools.
Re: (Score:2)
They will not get bash to work well under windows. The problem is the brain-dead and overcomplicated NTFS permission system. There is no way to get that handled without just as over-complicated and brain-dead "special" tools.
Yes, there is no concept of SUID/setuid on Windows. So there's no sudo "happy go lucky".
Re: (Score:2, Informative)
1. What is awkward with string parsing? Is this shell aimed at _incompetent_ people?
No, PowerShell is aimed at admins who want *robust* scripts - both the ad-hoc ones they whip up as well as the ones they choose to save. String parsing is extremely brittle, and most bash shell scipters do it the insecure and brittle way because it is easier.
String parsing is often thrown off if presented with unusual characters in file names, if executed in locales where dates and numbers are both generated and parsed different, etc.
2. And that works how on Linux?
OMI is available on Linux. Read the FTFA
3. An IDE in a Shell? Is the syntax so bad that you need an IDE? Or is this another effect of being aimed at incompetents?
You're the incompetent one. There'
Re: (Score:2)
I don't think you are going to reach an accord on Powershell syntax. I personally find it tedious, and frankly the Verb-Noun thing is backwards (Noun-Verb would have worked better, I don't need to know all the things I can 'Get', I need to know the things I can do to a Disk). That said, there is a convention, which is something that cannot be said for the more diverse set of shell commands.
In general the two camps need to recognize the situation for what it is. Empowering Microsoft shops to manage Linux
Re: (Score:2)
I agree. That said, and with all my not liking Powershell very much, it is a useful shell and it is vastly better than cmd.exe. If it gets more people to understand what the commandline is about, that is something. Might also make it a lot easier to get an MS admin to do at least some things on Linux and maybe even look at the native shells.
Re: (Score:2)
I am sorry, I have no idea what you are talking about. String parsing is bread&butter to any competent system administrator. Also, who puts spaces in their filenames?
That said,
find /home/johndoe | md5sum
makes an MD5 hash of all the names found. Maybe you have no idea what you are talking about? In fact,
find /home/johndoe -exec md5sum \{\} \;
works perfectly fine with spaces in filenames and does individual per-file MD5 hashes as it should.
Re: (Score:2)
What if you actually wanted and md5 hash of the directory listing? Now what?
That *does* give you the md5sum of the directory listing. To get the md5sum of every file you'd use
.`
md5sum `find
I'll answer (Score:2)
Yes.
Re: (Score:2)
It makes a difference because cron and rsync arent good tools for changing a configuration across a mixed environment with a single interface.
Re:I'll bite (Score:4, Insightful)
Nah. In PowerShell:
iwr "http://server/path/to/file.zip" -outf "${env:TEMP}/file.zip"
You can try to make it look more verbose. But expect to be called out on it.
Re: (Score:2)
Re: (Score:3)
PowerShell has its warts, but the command flags are more uniform and its own help search is simpler. Complex text manipulation isn
Re: (Score:2)
Powershell's warts, or at least it's biggest wart, its extreme verbosity, is what turns me off. Yes, the GNU toolkit, while having taken great strides to create uniform argument syntax, still retains some legacy cruft, but Chr-st almighty, the sheer amount of typing for even the most mundane scripts just makes me loath Powershell. I still prefer sh and its descendants, and I'll admit that is in part because I've been using them for 25 years, but Powershell is just way too bloody verbose, and it's why I stil
Re: (Score:2)
You can accomplish almost any task with fewer keystrokes in PowerShell compared to bash - and the resulting command will still be more readable.
Re: (Score:2)
No, developers don't want this. Administrators? Administrators? Administrators?
Re: (Score:2)
I can do a lot more with old linux tools than powershell have ever had the capability of.
What is it that Powershell can't do?
Re:Developers! Developers! Developers! (Score:5, Funny)
I can do a lot more with old linux tools than powershell have ever had the capability of.
What is it that Powershell can't do?
I hear that it's incompatible with systemd
*Ducks and runs
Systemd will integrate powershell someday (Score:2)
Systemd will integrate powershell someday
Re: (Score:3)
Some of those binary blobs though can be useful to move such a way. I recently had to merge, name match , rename and update a few thousand files on windows. I had to manually move them to a unique folder for initial seperation but the I typed ls -name :export-csv l..\list.csv
I then was able to use excel to match file names to what I wanted them to be renamed as and the used another csv to do batch renaming of the files in seconds with the csv containing the files to be renamed and their new file names.
That
Re: (Score:3, Interesting)
Build a script library based on short mnemonic commands.
Powershell's naming conventions and basic script library is insanely verbose. Man I hate that language. Damned useful, to be sure, and light years better than any Windows automation tools that came before it, but how I long for commands like sed, ls, mv, cp, head, tail, and so forth.
Re: (Score:3)
Re:Developers! Developers! Developers! (Score:5, Informative)
You can configure alias's quite easily in poweshell and in fact there are numerous alias's built-in for common commands. Out of the box powershell includes a ton of short alias's including "gci" and "ls" as aliases for Get-ChildItem, % is an alias for ForEach-Object, cp is an alias for Copy-Item, etc.
You can get a list of all alias's defined using Get-Alias (or gal). You can also create an alias using Set-Alias (or sal).
Microsoft generally encourages people to use the full command names in scripts for readability and to make them easier to maintain but there is nothing to stop you from using aliases everywhere including in scripts.
Re: (Score:2)
Yes. It even comes with something like 150 aliases predefined. Including ls (get-childitem), mv (move-item), cp (copy-item), and lots of others you'd expect if you're familiar with Linux.
Re:Developers! Developers! Developers! (Score:4, Informative)
Build a script library based on short mnemonic commands.
That's easy to do with set-alias. It already has built-in aliases for mv, cp, ls, cat, diff, echo, lp, man, ps, pushd, rm, wget and many more. Use get-alias to see the list of them.
For the other commands you listed, I use UnxUtils [sourceforge.net]. It's a lot lighter than cygwin, although the versions are very old.
Re: (Score:2, Informative)
Last time I tried Powershell, it had one major drawback that made me stop using it. Binary output (like PNG) from one program cannot be piped to another program without getting corrupted.
Powershell has some really interesting innovations, so I hope people give it a shot and make constructive criticisms so it can be improved.
Re:Developers! Developers! Developers! (Score:5, Insightful)
In the Linux world, Powershell is very limited. You may think it's powerful, but it's really very weak. If you know linux well enough, you have complete control over everything including the kernel.
So you claim, but I have yet to hear of anything that can't be done in Powershell. Undoubtedly there will be something, but I think that most of the time when people make this claim it is because they just assume that it is the case. But when asked to back up the statement...
Well, we can see what has happened. Just further vague claims.
Re: (Score:2)
And THAT is the reason why I install msys on windows machines, just to be able to use bash.
Re: (Score:2)
Re:Developers! Developers! Developers! (Score:5, Informative)
can be run without a GUI at all
Not true, or else you wouldn't be able to run 'notepad' on the console. Not that this is necessarily a big deal, but the Core editions are not GUI-free, they start cmd in a window. If you ignore the graphics console and use EMS only, the GUI is still running, just not visible to you.
Re:PowerShell is yucky yucky yucky! (Score:5, Interesting)
Then there is some stupid security setting I remember always running into whenever I want to use it.
This makes it sound like you havent done really any research or significant work with powershell other than running one-liners when you need to do something that cant be done in GUI (like deal with Exchange certificates). When thats your exposure, yes, it looks clunky, but thats also ignorance speaking.
The command you want to do to get rid of that prompt is (as administrator) "Set-executionpolicy -Scope MachinePolicy -ExecutionPolicy bypass"-- this sets it forever.
Powershell looks "ugly" because it aims for clarity, not brevity. Commands are explicit in what they do, such that anyone even with no powershell experience could look at most powershell scripts and get a pretty good idea of whats happening; consider a common one-liner below:
Get-ADUser -Filter {Surname -eq "Smith"} | Foreach { Add-ADGroupMember -identity "Domain Admins" -member $_ }
The commands are wordy, but they explain exactly what they do, and each of the parameters are self-describing; you dont need to look at something like "tar -xvzf someFile" and say "gosh, what does the z switch do again".
Re: (Score:2)
How does "mv" not explain what the command does?
Re: (Score:3)
Because some of the tools-- rm, mv, ls-- use a "take 2 letters from the word, thats the command" convention, while others are completely different (tar, unzip, gunzip, passwd, man). Theres no common convention whereby you could say"I want to do X" and know what the command is off-hand.
To the uninitiated, there is no particular reason to think "mv" would be the move command; you have to already know that.
Re: (Score:2)
Its an eyesore if your idea of a pretty scripting language is one that uses unconventional naming schemes and arbitrarily picked switches that require a man page to explain, sure. The beauty of powershell is you can do tasks you've never done before simply using tab-completion, relying on the parameter names to describe what they do.
Powershell is good for the same reason that this:
public String getFirstThreeCustomers (String[] customerList) {
final int NUMBER_OF_CUSTOMERS = 3;
S
Re: (Score:2)
Wordy is the key issue, look at your average unix app generally all the flags can use a short - or a long -- for the same function.
PS forget that 30+ years of unix shell to near perfection and rolled their own verbose and obtuse creation.
Re: (Score:2)
Wordy is the key issue, look at your average unix app generally all the flags can use a short - or a long -- for the same function.
How about if the unix app allowed only the long form option names - but allowed them to be abbreviated as long as the abbreviation was unambigous? (That's what powershell does)
PS forget that 30+ years of unix shell to near perfection and rolled their own verbose and obtuse creation
That why we still code in assembler and don't use those modern touch screens. Oh wait... (lalalalalalalal! -- fingers in ears, eyes firmly closed)
Re: (Score:2)
Well, I claimed to be a powershell user, not a Java pro. I still think the first example is superior if you're intending the source code to be maintained by other people and some of them may not be expert coders-- as will be the case with scripts.
Re: (Score:3)
Best practices be damned, you're rockstar coder. Who cares if no one else can look at that code and figure out why you created it and where its probably being used?