Live data from Hacker News

Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

news.softpedia.com

111–120 of 350 posts

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

#111

Earlier quoted context omitted.

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

It's not that weird, they put the alias' in so new admins on windows fresh from linux don't hit a complete roadblock at the first command they type. Its to make powershell less punishing to learn, not emulate a different system. So imagine when they packaged that for Mac, that assumption is no longer true.

They got removed in the open-source version of PowerShell and only remain in the Windows build.

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

#112

Earlier quoted context omitted.

Measure-Command {dir C:\} TotalMilliseconds : 2.9708 Measure-Command {Get-ChildItem "C:\"} TotalMilliseconds : 2.4161

Compare it with cmd.exe's dir

I have had a quick look through here [1] and most of the answers involve timing precision of two significant digits. By that metric, PowerShell's 2.4ms clocks in at 0.00 seconds. Which means cmd.exe (at a precision of two significant digits) can't beat it.

[1] http://stackoverflow.com/questions/673523/how-to-measure-exe...

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

#113
post #100
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.

Agreed. I like PS too but forcing it breaks a lot of staff, you cant use it interchangeably, eg 2 quickies: -bcdedit /c {xxxx-xxx-xxx-xxx} (= {..} is parsed as a code block) -invoking executables with spaces in path

Upgrade your staffs ;)

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

#114
post #60

Earlier quoted context omitted.

Being verbose would be a good thing (more readable than a cryptic acronym) if there was auto-complete support. A console should really be a small IDE that gives live feedback on what arguments are possible in the current context, etc. But that's not the way powershell was designed.

There is auto-complete support. I just tested it (not a powershell user myself), and it seems pretty intelligent. For example, if you type dir | sort it suggests Attributes, BaseName, CreationTime, .... All properties of file objects (which is what dir returns). Also there is PowerShell ISE, which is a IDE for powershell, but I haven't really tried it yet.

That's not what I mean by autocomplete. What I mean is more like Visual Studio's intellisense, ie a drop down that lets you know what are all the options from there. You can type DIR , that won't tell you that you can apply the parameters "/p" or "/w" nor what these parameters mean. ISE does a slightly better job but is based on a static specs, rather than the current state of the system. So it won't list the VM names currently active in the system for instance.

Yes you can type -?, but that's as bad as having to go on the web to read the documentation. It's disruptive. The point of a good auto-complete is to have a list at your fingertips with a short description of what it does, without interrupting your train of thought.

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

#115
post #107
post #66

Earlier quoted context omitted.

Hey, I'm still on Windows desktop after having tried Linux desktop more times than I can count. But to claim that bash (or most other shells) are only preferable to cmd and powershell if you're a linux zealot is what is truly laughable. If you have ever worked with both there would be no question.

I have worked with both and I would not claim that bash is superior to Powershell. I wouldn't even claim that my favorite shell, zsh, which is mostly better than bash, is superior to Powershell. They're different approaches and the only real benefit of bash is that it's super entrenched and extremely widely supported. With the same level of support Powershell would run circles around it. But since we're comparing thi…

> They're different approaches and the only real benefit of bash is that it's super entrenched and extremely widely supported. With the same level of support Powershell would run circles around it.

I'm not sure what you mean with this.

If you're referring to feature set and robustness with typing in scripting, I might agree with you.

I have however a much tougher time agreeing if you also think that powershell could come even close to bash/zsh when working from the shell, in both speed of use (and as you said) support.

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

#116
post #85
post #22

Earlier quoted context omitted.

No, it's not. PowerShell has aliases like 'dir' and so forth, but it's definitely not compatible. This will break a bunch of legacy stuff. That stuff probably deserves to be broken; the cmd.exe syntax has always been pretty disgusting.

It's not compatible at the syntax level, but it will also not break anything either. Batch files written for CMD will still be executed by CMD, not PowerShell. Unless you have an application that prompts the user to open a command prompt and then send keystrokes there to run commands, nothing will be broken here.

"Compatible because we run the other program" isn't really compatibility, it's running the other program.

Let's be clear: The syntax and idiosyncrasies and just plain stupidity of cmd.exe are very, very difficult to be compatible with. There's stuff in cmd.exe that beggars the words "awful and random". Deprecating the terrible thing that is cmd is a good move, it should have been done 20 years ago.

As I understand it, cmd.exe largely stagnated for a couple of decades because a senior dev at Microsoft "owned" the code and took any attempt to improve as a personal affront. It couldn't be changed without bad political fallout. (Frankly I don't care how smart or politically powerful you are: If you're doing damage to customers, you should be told not to, and lose your job if you keep doing it).

So Microsoft is finally getting it. I just wish that PowerShell wasn't their answer, because it's got significant problems of its own.

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

#117
post #40
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.

My work laptop still runs Windows 7 - and will for the foreseeable future - but that is one of the things that make me curious about Windows 10. It is, of course, easy to ridicule Microsoft for how long it took them to change this, but I think better late than never. (On older versions of Windows, ConEmu[1] does that, too, but it's third-party software, of course. It also supports tabs!) [1] https://conemu.github.io/

Since conemu is mentioned, I'll chimed in with cmder[1]. It builds ontop of conemu and has git-for-windows integrated as well.

[1] - http://cmder.net/

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

#118
post #66

Why ? Because some linux zealots think it's the best option ? Laughable.

Hey, I'm still on Windows desktop after having tried Linux desktop more times than I can count. But to claim that bash (or most other shells) are only preferable to cmd and powershell if you're a linux zealot is what is truly laughable. If you have ever worked with both there would be no question.

I've used various shells on UNIXes and powershell and they're both about the same to me. Powershell has clunkier syntax but has more features.

What exactly about bash would you say makes it superior?

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

#119

Earlier quoted context omitted.

Measure-Command {dir C:\} TotalMilliseconds : 2.9708 Measure-Command {Get-ChildItem "C:\"} TotalMilliseconds : 2.4161

Compare it with cmd.exe's dir

  c:\temp>timecmd dir c:\
  Volume in drive C is Windows
  Volume Serial Number is A0A8-6684

  Directory of c:\

  01/11/2016  12:45              AMD
  ...
  17/11/2016  12:52              Windows
                 9 File(s)         25,337 bytes
                18 Dir(s)  71,423,356,928 bytes free
  command took 0:0:0.08 (0.08s total)
bat from http://stackoverflow.com/a/6209392

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

#120
post #100
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.

Agreed. I like PS too but forcing it breaks a lot of staff, you cant use it interchangeably, eg 2 quickies: -bcdedit /c {xxxx-xxx-xxx-xxx} (= {..} is parsed as a code block) -invoking executables with spaces in path

    bcdedit --% /c {xxxx-xxx-xxx-xxx}
    & 'C:\Program Files\Foo\Foo.exe'
Post reply on HN