Live data from Hacker News

Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

news.softpedia.com

291–300 of 350 posts

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

#291
post #80

Earlier quoted context omitted.

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.

That's the difference - the extensions continue to work, but the gui link to the application changes. Essentially now people will open powershell instead of cmd without necessarily realising.

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

#292
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.

Alternatively you can use ConEmu[0] [0]: https://conemu.github.io/

I've found ConEmu's xterm emulation to be frustratingly buggy if I'm ssh-ing into a Linux machine and running tmux, vim, or really anything with colors or a status bar. mintty [1] works a lot better for me. (mintty is also the console that's packaged with Git for Windows.)

[1] https://mintty.github.io/

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

#293

Windows fan here. I hate PowerShell and I'd much rather have Bash built into Windows. Things I hate about PowerShell: - You can't even run your own scripts without performing the Set-ExecutionPolicy ceremony first or signing your scripts. - It's way too verbose. - It's a strange bird that next to nobody uses, so there's zero motivation to learn it. - It's not "old reliable". You can't depend on it working due to the…

I'm going to address each bullet: - Set-ExecutionPolicy can be set with a single click from the "For Developer Settings." Just scroll down and hit Apply three times and your machine has sane developer defaults (inc. ExecutionPolicy). - The verbosity means that you can "guess" PS commands. Each PS command is a set layout with an action word (e.g. Add, Clear, Get, Write, etc) and then target (e.g. Set-Alias, Set-Date,…

> If you wrote a PS file three years ago it likely still works today.

That's a really low bar.

Isn't Windows supposed to have a legendary commitment to backwards compatibility? 3 years of backwards compatibility would be nice for a bleeding-edge development environment like node.js that you can tear down and replace whenever you want, but not for your operating system shell.

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

#294
post #131

Earlier quoted context omitted.

IIRC you could resize the standard cmd console easily, just type "mode 160" (or whatever width you want). I don't have a Windows installation around to check it, but maybe someone can confirm?

Yes, that is correct. Display mode: MODE CON[:] [COLS=c] [LINES=n]

Hey!!! This works in PowerShell (non-ISE)!!!! Breaks my 112 column limit, despite a default setting of 200.

Added this to the end my Microsoft.PowerShell_profile.ps1 in my $HOME\Documents\WindowsPowerShell directory. (run: "notepad $PROFILE" in PS)

  MODE CON COLS=200
  Clear-Host (I get some artifacts)

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

#295

So, while I applaud this, I am concerned about the startup time of ps as compared to the old command prompt. Has it been improved recently?

Still slower than cmd, fast enough that I'm actively trying to unlearn the cmd muscle memory.

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

#296

Earlier quoted context omitted.

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...

"2.4" or "0.0024" or "24000" all have two significant digits. Leading and trailing zeros don't count as significant digits.

My mistake, you are right [1]. Thanks for the correction.

[1] https://en.m.wikipedia.org/wiki/Significant_figures

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

#297

Earlier quoted context omitted.

Someone else posted the evidence below. In an attempt to understand and empathize with people who do not share my opinions, I looked back through some of your post history and you said this 5 days ago: "It's never been clear to me why anyone would want to use a completely opaque and undiscoverable interface such as a commandline over a nice GUI for anything. You didn't have to read anything or search around in order…

That's a good point - almost everywhere I go as a consultant...their IT people use the GUI to manage things and not PowerShell. Most places that I've seen automate things with a .NET program whether it's a service, a console app run via Task Scheduler, an SSIS package and in a few cases - a desktop app. EDIT: I'm a programmer and not a sysadmin except for on my own network where I do prefer "the easy way" as opposed…

You seem to be missing the fact that powershell is just designed better. Take powershell vs bash. Bash operates primarily on strings. In powershell everything that is interacted with is an object. This wont really effect you in day to day interactions, but it is incredibly useful when you decide that you want to automate something. This combined with the fact that powershell is built on the .net framework means that there is a simple way to extend it from C#. You should give it an honest try sometime. Its not really that much more verbose in everyday practice and it has lots of tools around it that make life simpler.

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

#298

Earlier quoted context omitted.

I've used iTerm and Terminal on Mac, and the default Windows Terminal (conhost), PuTTY sand MinTTY on Windows. Terminal.app is much, much better than conhost, even after the Windows 10 update. It's fast, supports a ton of thoughtful features (such as customizable title bars via extended ANSI codes, real line wrapping during resize, good Unicode support from the very beginning, etc.). With Terminal.app I can be quite…

> good Unicode support from the very beginning I once started a Chinese character flash card program in Python on Windows. The yak shaving was unbelievable. I never got a working version, but I learned a lot about code pages, and why "building a console from scratch" is not actually the right answer to "I want to be able to test a toy program I'm making before it's finished."

Tkinter would have given you a basic Unicode capable GUI without the hassles of the console.

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

#299
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.

You could do this since at least XP!

You just needed to go in to the properties of the window and increase the screen buffer size (both width and height). It's one of the first things I'd do upon installing a Windows machine.

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

#300

Earlier quoted context omitted.

I've used iTerm and Terminal on Mac, and the default Windows Terminal (conhost), PuTTY sand MinTTY on Windows. Terminal.app is much, much better than conhost, even after the Windows 10 update. It's fast, supports a ton of thoughtful features (such as customizable title bars via extended ANSI codes, real line wrapping during resize, good Unicode support from the very beginning, etc.). With Terminal.app I can be quite…

> PowerShell's terminal experience is better but not quite there. And, PS suffers from extremely long load times - I've seen it take upwards of 10 seconds to start without any extensions. Small price to pay to be able to pipe objects , man!

Are you actually able to not be confused by piping objects? In Unix everything is a string so I just pipe text to sort and then unique...etc. PS always complains relentlessly. The GUI features and .NET integration is nice though.
Post reply on HN