Pleasantly surprised by powershell? I don't know what to say. I have to essentially copy and paste fragments of things that work, it's so arcane. Its like writing 90's Java on a command line. Its revolting.
> I have to essentially copy and paste fragments of things that work, it's so arcane.
I have about the same problem when it comes to bash. While bash may very well be described as "arcane" I believe this is mostly a problem of unwillingness to learn something new or different.
Understanding how PowerShell works takes a bit of time and re-thinking. It doesn't help that there's so much downright bad PowerShell code out there that was mindlessly converted from VBScript. Still, it's not that hard and the language is quite consistent and, well, powerful. They made quite a large effort to make sure that the underlying concepts are orthogonal and pervasive throughout. So learning just a few concepts actually make a very large part of the shell and language approachable and easy to understand.
Fair point. PowerShell is three things, actually: An embeddable scripting runtime, a scripting language, and a shell. The latter is (by name, probably) what people see it as, usually. Furthermore, most usage examples throughout the web use it for things that are traditionally done in a shell, e.g. interactive use, or small scripts that mainly do filesystem maintenance stuff.
You're right in that Python may be a more apt comparison, especially in that PowerShell's .NET foundation serves as the equivalent to Python's included libraries.
But that's a discussion that would have to happen every time people try to think of PowerShell as a weird bash. And it is a capable and useful shell, too. It just can do a lot of things much better than bash; they just look different.
When powershell comes up, someone always gripes about how they can't do this or that like they can in bash. I'm not going to deny that grep is nicer to use that the powershell equivalent (Select-String). But you don't configure Windows and other software in the Microsoft ecosystem by messing around with text. For example, if you had a new user and you wanted to set up an account, email address, and phone number (so AD, Exchange, and Lync/Skype for Business in Microsoft land), it wouldn't just be hard using something like Cygwin, it would probably be impossible. There is just no way to talk to those programs text streams or config files.
I guess what I always want to know when people complain about powershell is what they were actually trying to do. I think it's an excellent tool for system administration in a Microsoft environment. When you start moving away from that use case, it gets less and less useful.
the problem with powershell is that it is incredibly stupid if you're not on a full windows stack (desktops, servers and near enough to everything inbetween) and running the most recent version of windows (ever tried getting winrm installed and reliably working on a 2008 box?)
perhaps if they were not too opposed early on to horrible open source things and just one of the languages that already fit fairly well in that area (python for example) they wouldn't have had to go out of their way to make pretty shitty hacks (i really wonder if anyone in the powershell\winrm team did any testing or development with the machines more than 10 metres away)
Yeah, PS remoting is basically a no-go before server 2012, and even then it's just barely functional enough to be occasionally useful. They're planning on adding SSH support though, so I'm cautiously optimistic.
I don't think something like Python would have been a good choice to use instead of PS. While I'm sympathetic to the complaint that PS is more of a programming language than a shell, that's even more true of Python. I use PS as a shell far more often than I use it for complicated scripting, and as much as I like Python, I just can't see using it as a shell.
I suspect you haven't read the documentation or tried using PowerShell for any length of time. PowerShell may be bash-like, but it's not bash, does not try to be bash, and won't reward you if you treat it like bash. But it's very orthogonal, clean, and well documented.
For your particular example:
> help grep
Name Category Module Synopsis
---- -------- ------ --------
Out-File Cmdlet Microsoft.PowerShell.U... Sends output to a file.
Select-String Cmdlet Microsoft.PowerShell.U... Finds text in strings and files.
Okay, so Select-String sounds really promising. Let's take a look.
Most of those command flags seem really straightfoward to me. Can you be more specific about what was unclear to you? I'd be happy to help.
EDIT: BTW, it's a bit annoying to type Select-String, so it'd be nice if it had an alias. Does it have one?
Well, you can get aliases in PowerShell by typing alias. But that'll give you a wall of text; what you want to do is to quickly search for things that are aliased to Select-String.
There are two ways to do this. First, you can pipe to a GUI that allows directly filtering the results:
> alias | out-gridview
Or, alternatively, we can figure out what objects alias gives us:
> alias | select -first 1 | get-member
Note that we've got a Definition field, and query on that:
> alias | Where-Object { $_.definition -contains 'Select' }
which is a long version of
> alias | ? { $_.definition -contains 'Select' }
And notice that Select-String is aliased to sls by default. Note that I can just reference the column by name, rather than going through some awk/cut fun.
You might be annoyed that Select-String is not aliased to grep. While many commands actually do have multiple aliases to both DOS and Unix equivalents (e.g., Get-ChildItem is aliased to gci, dir, and ls, and Remove-Item has ri, rm, and del as aliases), Select-String works differently enough from grep that it's not a default alias so you're not confused.
Fair enough, and I have and will continue to not really want to invest time into learning Microsoft's stuff, based on past experiences (my first being wanting to develop for the platform as a scrub, and they charged thousands of dollars for a dev environment/compiler). I honestly don't think it'll serve me well going forward, when there are better alternatives.
They have had decades now to get on board with developers, and cmd.exe is still their go-to console. They still strike me as a company of greedy corporate business folk, who happen to run a software company, as opposed to a software company that has to suffer greedy corporate drones to survive in our current race to the bottom.
Correct - it has a couple of crippling features, such as wrapping output at 80 characters even if piped to a file (unless you tell it otherwise every time).
Personally, I'll never forgive them for their practices. They deliberately stifled competition, shafted developers, abused their position, and rubbed it in our faces.
There's no coming back from that, and I'll gladly educate newcomers to IT on their ways.
Let them die. The new CEO could be the second coming, you can't fix that cancerous attitude that is entrenched.
They deserve to become obsolete, at the very least.
A lot of the people that were there when practices were at their worse are no longer there.
I don't think I would be able to use any form of technology if I was to hold a grudge for every large company that performed some sort of bad practice, with slave labor to privacy issues.
Luckily people that perform these bad practices will eventually get ousted and replaced, that's when I proceed with caution.
You can wish Microsoft would die, and still use an iPhone.
In fact, much of Apple's success can be attributed to Microsoft fumbling the mobile revolution. In other words, people who use Apple may be doing so directly because of how much worse Microsoft was -- due to Microsoft spending their limited resources on zero-sum tactics like shafting their developer ecosystem.
Compete or die. (Microsoft seems to act like they have a third alternative, monopolize. They're still immensely profitable so it's understandable that their shareholders are comfortable with their current course.)
I personally don't use any iThings. y4mi, do you have concrete examples of what Microsoft has done that has significantly improved end users' ability to run Free Software?
Out of curiosity, is it fair to assume you use hardware and software by a source you consider more ethical then? (your classification above rules out Apple and Google as well since they've both done less-than-stellar things )
I basically do my best yes, whilst having to earn a living in my chosen field. FreeBSD and Linux where I can advocate them.
Part of my current contract is migrating a customer away from SQL Server to Postgres, and it feels good. Automating powershell on aws instances doesn't feel so good, but it's temporary pain.
Do you speak badly of Apple and Google whenever possible though? Forget about tech corporations - do you speak out against other non-tech corporations as much as Microsoft or is your hatred especially reserved for them? What kind of computer hardware do you run?
Typically, if someone hates Microsoft, they love either Apple or Google. That's been my experience at least.
Apple (Worst Offender but also helped Open Source at times)
Microsoft M$ (Middle of the road with it always depending on who you spoke with at the company)
Google (Most powerful of the three in terms of control over people's lives if they wanted it, but I seriously think they stumble ethically not on purpose. I believe they try to follow, "Don't be evil" as a whole)
Why is Apple the worst offender? Many would put them above the rest because of their stance on privacy.
> Google... stumble ethically not on purpose.
Stumbling? When they ripped off Sun, they did so with deliberately and with awareness at the highest levels. There are emails revealed during the trial that leave no doubt.
> Why is Apple the worst offender?
(Top of my head) Lies and more lies (Power PC more Powerful than Intel X86, No malware, no virus, we are the definition of Innovation), Closed Wall Garden, Over Promising and Under Delivering, Patents, The eBook Price Fixing, the Approval Process on iOS, No Competition Hiring Agreement, Amiga Computer was 7 years ahead of the time and Apple lied about it for YEARS, Promising a Color Mac and it would be a simple card upgrade TOOK YEARS, and perhaps the worst of the lot iTunes GUI!!!!.
> When they ripped off Sun
Than why did Sun's CEO congratulate them? Sun also loves to rip off people look at Oracles' Unbreakable Linux AKA Redhat Linux.
I seriously have 30+ years of Apple hatred from before my Amiga days. Amiga community HATED Apple for their business practices and clear lack of innovation. I went to buy a Mac with my dad when released and my dad say the writing on the wall. Lies and more lies and Lisa wasn't more powerful just more expensive and you still sell those?
> Google (Most powerful of the three in terms of control over people's lives if they wanted it, but I seriously think they stumble ethically not on purpose. I believe they try to follow, "Don't be evil" as a whole)
Um I read every word. I fail to see the Lighting Bolt ah ha. Yes Google is in the data collection business. They have stated it since day one and in every product they produce. GMail was a GB of space if we get to send you ads.
That they were HUGELY upset that they would lose a data collection stream? Or that they were trying to figure out what to do? Android as a service has requirements or you can make a Fire Phone like Amazon did with the Open Source code of the product doesn't seem like M$.
You can explain what I am missing but the fact that we have Amazon Fire Phone and Fire Tablets all based on a fork of Android seems to kill the implications of these emails.
Are we really back to calling UI design decisions "evil"? That word used to mean something, and slightly inconveniencing people who use YouTube wasn't covered.
On the other hand, Google+ as a project was an aberration, and the guy mostly responsible for it has left the company. My question is, have Vic Gundotra's superiors learned the proper lessons?
That said, the Google+ real names insanity removed all my trust in the company's products at that level, and I'm only now considering doing business with them due to their low cost of cloud storage and trusting them at the technical and operational levels more than Amazon.
But its attitudes like this that drive people toward Ms. Everybody can see that other companies are doing the exact same thing. For example there is actual proof of Apple conspiring to keeping developer's wages low.
I don't think that's a fair position to take, fair to yourself that is. The company then is not the same as it is now. Enough time has passed since then and now that it's safe to assume that all the people in important positions have been partly replaced, and I'm sure the majority of those who remain are now in different situations than they were back then.
I think it's wrong to withhold fair consideration for MS products (specifically) just because they did something you think is wrong years ago.
You can't forgive a corporation. Corporations aren't people, they have no conscience, no morals and no ethics. The entire concept of forgiving them, or being angry at them or whatever doesn't make sense. It's like forgiving a lion for eating your brother and thinking it won't eat you. It's a lion. It will eat you when it gets hungry. That is its nature.
Microsoft isn't going to die, but their enormous influence has eroded nicely. They're a mature, profitable, mostly boring company and I'm okay with that. XBox is pretty hip, but the reset of the company is about as interesting to the general public as Oracle, Cisco, or IBM.
Microsoft is as hip and alive as Google is. Google is a boring info-utility to most people. The Xbox is absolutely more cool than anything Google has in their pocket, including Android and self driving car experiments.
From a technology point of view, there are things I love about each company. Microsoft's Azure is pretty neat as is Google's Compute Engine. None of that matters to most people though.
Seriously. Microsoft has an unmatched record of screwing pretty much everyone who did business with them, and otherwise abusing their position in the market. Worse than IBM when IBM was in their position.
Are you sure you didn't mean "Oracle"? As far as I know, Microsoft deals with their business partners fairly. They don't try to negotiate a deal directly with a big customer and bypass their partners, for instance.
I'm talking more about "peers" than what I think you're referring to as "partners". E.g. 3Com as I cite elsewhere, Verizon WRT to the Kin, the company they licensed the start of Internet Explorer from (expected royalty payments never materialized when the gave it away for free), the examples go on and on and on.
But I suppose with Balmer the salesman in charge in between Gates and Nadella they'd avoid sales channel betrayals like that.
With regards to the Kin, I think Verizon shafted MS on that one. The device was good for it's time (something with photos and music targeted at teens that didn't have a full web connection), but Verizon forced you to buy a full $30/mo web plan to use those features (this was back when the web options were $30/mo unlimited plans or no web connection at all).
If there was a cheaper connection just for the Kin, it would've done reasonably well as a replacement for the Sidekick.
The lateness of the Kin is supposed to be one of the reasons Verizon did that, the market window had passed. It was also only a fraction of what was promised, heck, what Danger and T-Mobile delivered years earlier (as far as I know you're wrong about what it actually delivered at launch vs. what was promised).
Microsoft's database blunder with the Sidekick less than a year before the Kin's release (https://en.wikipedia.org/wiki/2009_Sidekick_data_loss) also contributed, I'm sure, at that time few were willing to trust them with their data. It's a testament to how far Microsoft has come that that's apparently changed with Azure.
In this case, I view Verizon as replying in kind. Which is part of my point, when you treat your peers like s*, there are consequences.
> Microsoft has an unmatched record of screwing pretty much everyone who did business with them
Could you list instances of this? Don't get me wrong, they have been absolute bastards in some cases (https://en.wikipedia.org/wiki/I4i is my go-to example). But keep in mind it is a huge company that has done business with thousands of firms over the past few decades, so to substantiate your point, you would have to produce a pretty big list.
While your request is not in principle unreasonable, it's way too much work for me to prove it to your satisfaction, or my satisfaction in a formal, balanced, I'd be willing to publish it way. E.g. I'd forgotten about I4i, despite the prominence of the case.
I'm basically asking you, absent either of us going beyond searches like https://www.google.com/search?q=list+of+microsoft+crimes ^_^, to trust my observations of these businesses since the fall of 1977 when I started in the field. Heck, I was a great fan of Microsoft until NT 3.51 SP2 (and for a while beyond, it was Vista that completed the job). It was a pattern of behavior that became more and more obvious sometime in the late '90s that changed my opinion of the company, capped with their all out illegitimate assault on Linux and FOSS starting in the early '00s. And I of course don't expect you to take my word for it.
I just don't see it in their peers, not even Oracle.
Ah, here's a different angle: name the healthy peers that are willing to work with Microsoft today, beyond what's absolutely required. Yahoo! fails hard on healthy, Mozilla potentially as hard. I don't understand why/how Yahoo! is still in business, but Mozilla sure seems to be in their endgame (one reason I'm avoiding Rust for the time being).
You're acting like you hate the company just because they screwed their competitors. Do you hate other non-tech companies who screwed their competitors or is your hatred in this category especially reserved for Microsoft?
Do you speak ill of banking corporations as often as you do of Microsoft?
Also, if you run Apple hardware at all do yourself a favor and take a look at all the screwed up shit that Apple has done because that company has always been an asshole to just about every entity that they come into contact with.
I don't hate Microsoft today, and only did during the period they posed an existential threat to Linux/FOSS (and it was a relatively gentle sort of hate, made particularly easy by Vista).
I don't run Apple hardware, never have in my life. In part because I count them as worse to users (well, prior to own goals like Vista and Windows 8), but also because as of late they've been behaving particularly bad. Made that decision in 1987, who knew, avoiding particularly closed ecosystems turned out to be a good idea all around in the long term.
I don't "speak ill of banking corporations" because I don't see, well, any that I can think of offhand in the US, being actively, aggressively evil. Stupid in many cases, for sure, but that's a different thing, and not axiomatically akin to Microsoft's crimes.
They're not falling for anything, its just plain and simple greed. My father was in the radiology area and he constantly received 'bribes' (didn't accept them, but had the offers).
Perhaps, it just sounded like you thought these very intelligent (for the most part) doctors, were unaware of what they were accepting, which isn't the case.
It's very clear in the industry that it goes on, and anyone that partakes is a scumbag, in full knowledge of what they're doing.
This in an industry that is meant to heal people, not be part of the problem we're facing with rampant corporatism and out of control greed.
Any time I read this type of article, I keep recalling what irritated the hell out of me with the Snowden leaks and responses of US citizens. To paraphrase: "It's terrible they're spying on US citizens (but everyone else is fair game, geez, whack a splicer in that fibre channel asap)".
The US has reinvented the concept of borderlines on the Internet with what the NSA/TLAs have been up to. I'd say that's a distinct step backwards.
The response of most US citizens has been, "Snowden?"
But then there are plenty of people on HN who should know better who are outraged, OUTRAGED to discover the US is spying on people, but seem to have no issues with their own and other governments spying on them. So it's ignorance and hypocrisy all-round.
Well, all of the Five Eyes are complicit, no argument there. Certainly a top-heavy weighting from the US though, with basically control of the net, and a stellar budget. The peons just follow the marching orders.
Seems to still be a lot being done in the name of security theater in the US, and just wasting dollars on the TSA, for what appears to be very little effect.
Who's really profiting there? Is it just for the employment of people that otherwise wouldn't have a job? Or are the majority of citizens there really made to feel more secure by having them? I'd have to say some defense contractor is getting a bit fatter off this.
"Michael Chertoff has been an advocate of enhanced technologies, such as full body scanners.[25] His lobbying firm Chertoff Group (founded 2009) represents manufacturers of the scanners.[26][27]"
"Michael Chertoff (born November 28, 1953) is an American attorney who was the second United States Secretary of Homeland Security under Presidents George W. Bush and (for one day) Barack Obama, and co-author of the USA PATRIOT Act."
It isn't just a defense contractor, it's the former head of the DHS who implemented these policies and gets kickbacks from body scanner use. He set up the nationwide deployment of the scanners, then profited directly. It's corruption to the extreme.
You'd think, but year after year we get stories like this. Sometimes it catches up with people [1], many times it seems they get away with it [2]. The main difference seems to be how much money they're worth, if they're elected or just "regular" employees, and how good their connections are.
It sucks to watch corruption and violence win the day. We seem to be seeing it. Where an economy can be based on maintaining a military force in other countries, to maintain the petrodollar and central banks. And a lot of good people losing their lives, brought up in the belief, they're helping freedom. What a mindfuck that is.
After a few years people get acclimated and if you dare to criticize the corrutpion you're seen to be evil.
For instance, try telling the average american that the TSA needs to be shut down.
They'll think that they're keeping us safe, the same way people think that police keep us safe, and will think that without obamacare we wouldn't have health insurance, in a few years.
I find the sudden mention of Obamacare rather odd. TSA has done jack all to keep us safe in the decade and a half it's been around. Obamacare, while deeply flawed, has done quite a lot to help people access health care.
The people paying for it (US citizens and those who travel into or through the US) would surely see it as a waste. But the people profiting don't, and the people profiting are the same people who make the laws mandating them.
I opt out of the naked scanners every time I fly. Just tell the TSA clown trying to herd you into the naked scanner the magic phrase "I'm opting out." After a 5 minute wait, some other clown will come over and molest you, and then you're free to go.
I do this as a little protest against a system I see as stupid and illegal. If everybody opted out, the system would get so backed up that they would have to change their policies. I'm doing my part, and I encourage you to do yours next time you fly. (Unless you're not white, in which case you should probably just keep your head down :-/ )
I'd do it if I have cause to fly into the States again, but I can't help but think its not really going to help much. From my youthful experiences at being a knob, I'd say don't piss off food makers/deliverers, or airline staff. I once annoyed a Qantas security lady, and I noticed it for a fair few trips afterwards. Then again, with wealthy interests controlling the US, I can't really see what will help at this stage. Its a descent into corruption and mess, but I can't judge how quickly it'll crumble.
You can opt out politely; I do it all the time. Recently, it's been interesting, since I dislocated my shoulder and can't yet lift my arm as high as they want me to. But it still seems to work out.
I always opt out of the "rapey-scan", then smile and groan a little whenever they pat me down. I also travel about 30-40 segments a year, so I get my kicks frequently. It's surprising how often that "TSA Precheck is closed" or the TSA Pre metal detector beeps just for me.
I also opt out every time. At one point the FSM came to me in a dream and told me that I shalt not go through a pornoscanner. And who am I to doubt the word of noodle?
The upshot of TSA is that because it's a single government organization, it's easy to identify the costs and quality of operations.
Pre-TSA, we were wasting the same or more amount of money on private contractors of dubious quality. But you didn't really know how much, as the cost was spread across thousands of airline/airport authorities/municipal government combinations.
I would be very surprised if the federalized version wasn't much more expensive -- for one thing, because its centralized its a bigger and more profitable target for vendor lobbying for requirements that necessitate the purchase of particular goods and services (whole body scanners, etc.)
Are you sure it was the same amount of money? Before the TSA, airport security agents were very minimally trained and there were no expensive body scanner machines.
I would not be surprised if the TSA version of airport security cost 10x the previous version.
Don't underestimate the cost of bodyshop-style arrangements. The guy fumbling through your luggage may have been making $8/hour, but the billing for it could have easily been 8-15x the salary.
A good point. It seems to me an increase in people annoying you throughout the flying process is only going to have increased costs, coupled with expensive hardware and presumably billions in software too.
Speaking for Tasmania, there's a desolate looking guy on the Hobart bomb scanner device every time that flags me over. His face says it all, "I know this is a bullshit job, just submit and it will be over with quickly, I collect a paycheck, you feel bad for a little while."
The true cost dwarfs what any budget says - the time that everyone wastes (getting to the airport needlessly early, waiting in line, being molested, missing flights, obessing over packing the "wrong" thing, and inventorying your luggage immediately after landing). When you add this up, how many human lifespans has the TSA killed?
Definitely a way to find a silver lining hehe. Maybe we're getting better at shining a light on things, and they'll crawl back into the slime over a generation or two.
Naive response on multiple levels. An ad hominem implies that the criticism is superficial or irrelevant to the main issue. Money is the main cause from a realist point of view, not an accessory. Money waiting to be made is the first item in the chain of causation for many (most?) government projects.
The outline: problem in government that can be solved -> contractor group identifies problem -> contractor group contacts their lobbyist -> lobbyist lobbies government at right points -> contractor group gets contract to solve problem for far more $ than the problem is worth (usually) -> lobbyist can now find another job for the contractors as soon as they identify another problem.
Ask qui bono, ruthlessly. Follow the money from branch to root. Do some research on where the money is ending up, and you'll find who set the process in motion via corruption.
On a side note, Americans will never feel safe because there is a pervasive circus of media and behavioral memes which encourage fearfulness and paranoia. Have you ever seen the nightly news? Have you ever talked with a mom? We could be sitting alone in sterile jail cells, and people would still worry that the jail cell being cold might give us pneumonia.
> Quite a lot of the stranger aspects aren't so much "features" as blast craters of past disasters.
Cracked me up, very well said. In general I agree that the document-centric browser has been abused horribly. Then we get obscene beasts like node.js, because, well, the browser does it, so must we.
Node.js is interesting, and while it wouldn't be my first choice I can see how it came about. AJAX in the browser leading to Javascript developers evolving a callback-chaining style; realising that they could use the same language and style on the server; the inherent high efficiency of single-process nonblocking callback orientated servers.
Does anyone think that JavaScript could overtake PHP as the "go-to" language for server-side scripting with Node.js as the "go-to" runtime?
Despite my indifference to Node.js, I can see the unification of client-side and server-side scripting into a single language being incredibly valuable to the millions of PHP and JavaScript developers (both front and back-end) out there: most of whom beyond the realm of HackerNews and want to get it done.
Not only that, it would significantly reduce the barrier to entry for web scripting and disincentivize beginners from picking up all those nasty habits such as md5 password hashing and manually constructing SQL queries from raw input which are so worryingly accessible.
The only thing I can see preventing this are:
1. Lack of a mod_node for Apache. Perhaps this exists?
2. The upload and refresh workflow so many PHP developers are familiar with
3. A scheduler to prevent any one website from blocking the Node.js event loop on shared hosting
There's createdb from memory (?), but for other bits and pieces, it might be worth spending a bit of time on a thin wrapper script e.g. "create-pg-user foo" that just wraps the annoying parts, but using your environment specific bits and pieces if needed, or using a C/Python/Ruby/Java/etc api. At a bit of a different level maybe some Ansible playbooks that hide away the psql level stuff, so they can be reused.
I fully agree though and in thinking about it, a range of CLI level tools would be nice. I guess then the team would have to play catch up with any syntax/api changes for those tools too, so its adding that annoying extra bit (albeit fairly small probably). But I guess its the annoying extra bit getting down in one place, and not hand-crafted by everyone.
My immediate reaction is, if they hire someone that has great security knowledge, they'll be better placed to compromise mine; their business model seems to be pillaging my data and selling ads, same with Google.
No grads worth hiring globally? I don't hire, but that seems a bit rough anecdotally knowing a few.
I had a quick read of some parts, but I'll have to sit down and read it properly tomorrow once the beer has taken its course. I didn't find the bits I browsed particularly revelatory, and focused fairly narrowly on erlang.
Any particular sections you think would turn those unhirable grads into hirable ones?
Still to this day I can't even fscking grep.