Live data from Hacker News

Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

news.softpedia.com

71–80 of 350 posts

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#71

Just another reason to stay away from Windows as a platform. Windows 10 is a moving target if you are trying to work with it.

If you're not a fan of change, I feel like software development probably isn't the right career choice.

Not sure how that is related. Its years ago i last time used Windows for anything development related. And honestly i would prefer the old cmd because its easy to install Gow into it. It seemed quite harder to have my common environment working properly in Powershell without actually learning at least some of that syntax stuff last time i tried.

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#72
post #35

Something that irks me is how PowerShell’s default aliases take precedence over binaries in the PATH. To be able to use the GNU utils, you have to put this in your profile.ps1 : Remove-Item Alias:cat Remove-Item Alias:cp Remove-Item Alias:curl Remove-Item Alias:echo Remove-Item Alias:ls Remove-Item Alias:man Remove-Item Alias:mv Remove-Item Alias:pwd Remove-Item Alias:rm Remove-Item Alias:wget

There was a long argument about this in a thread previously but in my opinion they should not change this now.

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#73
post #27

Btw did anyone noticed that in windows 10 you can resize cmd.exe to more than 80 characters width! When I first saw it I almost cried.

And you can use Ctrl+C Ctrl+V :) If you upgraded from a previous Windows you need to disable legacy mode.

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#74
post #47

Earlier quoted context omitted.

How would an alias work otherwise? That's pretty much the way it behaves in Unix, too (e.g. 'ls' in most default configs). Although I'd still consider curl/wget to be specific tools and not generic commands, so emulating them seems a bit weird.

The point is that they're defined by default. See this story for more background: https://news.ycombinator.com/item?id=12319670 Edit: the RFC intended to address the curl author's issue was rejected. https://github.com/PowerShell/PowerShell-RFC/blob/master/X-R...

Yeah, because it would represent a breaking change.

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#75
post #63

Earlier quoted context omitted.

Seriously? I wonder how they managed to do that, i am sure that required a whole engineer team for a whole month!

https://technet.microsoft.com/en-us/library/dn167709.aspx > Every idea for a feature starts out with an imaginary deficit of -100 points. That means it has to demonstrate a significant net-positive effect on the product as a whole in order to emerge as being truly worthy of consideration.

That is actually pretty interesting, thanks for linking!

I still dont understand how this was not "fixed" years ago, sure some config windows have fixed widths because it makes sense, but something as a terminal obviously needs the ability to grow (or shrink), especially after they introduced sticky windows and people actually used "tiling"

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#76
post #3

"Typing cmd in the run dialog will launch PowerShell as well" What? I'm a big PowerShell fan, but I see the need to keep cmd around for a while. Clobbering it before it's phased out seems problematic.

Microsoft are taking Apple's approach!

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#77
post #35

Something that irks me is how PowerShell’s default aliases take precedence over binaries in the PATH. To be able to use the GNU utils, you have to put this in your profile.ps1 : Remove-Item Alias:cat Remove-Item Alias:cp Remove-Item Alias:curl Remove-Item Alias:echo Remove-Item Alias:ls Remove-Item Alias:man Remove-Item Alias:mv Remove-Item Alias:pwd Remove-Item Alias:rm Remove-Item Alias:wget

The weird thing was that Powershell for Mac doesn't do this.

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#78

Personally I want to use PowerShell. The show-stopper for me is that I cannot set default encoding for output redirection (>) to ascii/utf-8. This is so important for things like Google Code Jam, etc.

I agree it's annoying¹, but I wouldn't call it a show-stopper. I have resorted to Out-File -Encoding wherever I need file output.

_________________

¹ The redirection syntax cannot easily accommodate an encoding, so in general you cannot really use it everywhere anyway. I often need to use the system's legacy codepage instead of Unicode, so UTF-8 by default would be just as useless there. GCJ, however, could just accept text in any common encoding instead of insisting on ASCII. Detecting UTF-16 isn't hard, even though common Unix tools tend to treat it as arbitrary binary data instead of text.

Generally I'd say > is a convenience feature more than an actually useful construct, at least in a shell like PowerShell. On Unix-likes > simply dumps bytes since that's what the shell is built around. For PowerShell you could just as well say you'd dump CLIXML instead, since the shell works with objects. Since you have a few valid options you could either try to shoehorn them into the syntax, either with various funny characters

    Get-Data > data-as-utf8.txt
    Get-Data >@ data-as-clixml.xml
    Get-Data >% data-as-utf16.txt
    ...
or add another expression somewhere

    Get-Data > data-as-utf8.txt,[Text.Encoding]::Utf8
all of which are options I'd say don't really fit into PowerShell, nor should they be entertained. Does it really matter whether the last part of a pipeline is a redirection operator or just a terminating command that writes the data to a file? Conceptually I'd say having the pipeline end in a pipeline element instead of something entirely else is preferable since it reduces the number of distinct concepts.

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#79
post #53

By the way, where does the capitalized kebab case come from? Prior art or just Microsofts general hankering for capitalization (e.g. C#s Class.DoSomething() vs Java's Class.doSomething())?

What you're thinking of is PascalCase

https://en.m.wikipedia.org/wiki/PascalCase

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#80

Earlier quoted context omitted.

How is that any different from Linux distributions camping their default shell? Like back when debian changed their default shell to dash I don't remember anyone saying you should stay away from debian, even though it broke a lot of existing scripts.

That's a bit different. The change only exposed that some scripts were already broken and worked by accident. Specifying that your script should be run with #!/bin/sh and then using bash syntax is what broke them. It's a bit like naming your files something.c, writing the code in C++ and compiling with `cc` just because `cc` happened to be linked to `c++` on your system. It will work for you, but don't be surprised w…

So there is actually no difference at all on Windows, then. Batch files have .cmd or .bat extensions and will continue to be run by cmd.
Post reply on HN