Live data from Hacker News

Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

news.softpedia.com

331–340 of 350 posts

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

#331

Earlier quoted context omitted.

But are all cmd commands portable verbatim to powershell? With all the options / special characters? (I don't know the answer, but https://en.wikipedia.org/wiki/PowerShell#Comparison_of_cmdle... lists quite a few missing commands, including "talkkill" and "find") With the amount of online posts that tell you "to achieve X, open command prompt and run ...", it would be a bad idea to break any of them that go beyond a…

There can be several aliases for a single command. ls=dir=gci="Get-ChildItem" But you can't run just run "dir /s". You'd have to say "Get-ChildItem -Recurse" which can be shortened to "dir -Recurse" which can be shortened to "dir -r". When scripting, you try to use the longform versions. With one-liners, you just sort of fall into whatever paradigm you were previously accustomed to for your first argument.

Such basic commands are actually CamelCase? It must be a pain for those with no short-aliases.

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

#332

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!

I'm not entirely sure if you're joking or not (one of the hazards of the textual communication medium). Yes, piping objects is fun and occasionally very useful, but waiting ten seconds to pop a terminal so I can run `ipconfig` or something is not so useful.

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

#333
post #216

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…

Literally every windows admin uses it. It's the official commandline interface for microsoft software. Every piece of microsoft software must provide a ps interface. It's an engineering directive.

> Literally every windows admin uses it.

And how much people with those be? Probably a lot less that software developers in general, and non-windows admins.

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

#334
post #88

Earlier quoted context omitted.

Well, the nice thing in PowerShell is that you have explicit control over "stop parsing here and just pass the rest to the application verbatim" with --%. Solves a lot of quoting nightmares.

How come none of the tutorials I've read and StackOverflow questions involving Start-Process mention that? Thanks.

Well, it won't work with Start-Process, and it's also buried deep in the documentation and impossible to google. I constantly forget about the exact character sequence, too.

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

#335
post #218
post #176

Earlier quoted context omitted.

Related, running something like decrypt hugefile.dat | encode outfile.dat will usually result in powershell using up all your system ram and crashing.

Most likely because it loads it all into memory, rather than say streaming it.

That's how I would expect MSFT to build it.

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

#336

Earlier quoted context omitted.

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

Sorry about that - we lost control of our startup times in PS V3 and have been working to get it back under control. PowerShell V5 had substantial improvements but we keep working on it and V5.1 is even faster. Give it a try - I think you'll like it. Jeffrey Snover [MSFT]

I really hope so!

I basically stopped using ps ( for smaller stuff) because the startup tone is so awful.

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

#337

Earlier quoted context omitted.

The ise can do that if you've got the object at the time you're writing like that, it can't run a command for you as your typing it. You'll never get a drop down list in the host terminal windows has it doesn't have a GUI layer like that. Wrap it in a electron app and make one. you can type `dir - ` and cycle through the options. type `get-help dir` to see what they do or install posh-git and use `dir - ` to get a me…

You'll never get a drop down list in the host terminal windows has it doesn't have a GUI layer like that. Except you do, with PSReadline, built into Windows 10 PowerShell.

Sorry yes that's psreadline not posh-git like I commented. I wouldnt' call that a drop down though, that's just adding to the output isn't it? You know I've no idea how that works, could come in handy actually I should learn.

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

#338
post #164

Earlier quoted context omitted.

Drag-resize (affecting buffer, as well) is nice, finally. And you can change opacity in properties, making your window transparent. What I really like though: you can now use Shift + arrow keys to select text and C-c/C-p to copy/paste.

If you're going to use CMD/PS on windows you might go whole hog and install ConEmu. Then load it up with Cygwin, and DosBox. ConEmu can even integrate stuff like Putty.

Thanks for that suggestion. I am well aware of these options, and if I used Windows at home, I could utilize these. However, I only use Windows when I have to, which is at work. The environment in which I work, you can absolutely not install software like this, as you would be breaking security protocols (and the law).

So this explains the joy I feel over small improvements like those mentioned above.

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

#339
post #158

That's nice. Can you pipe binary data without powershell corrupting it, or is that now a feature? https://brianreiter.org/2010/01/29/powershells-object-pipeli...

This bit me badly when trying to pipe GPG output. I ended up building a command string and sending it to cmd. :|

That is odd, powershell shells out to cmd.exe if you try to pipe binary or text data. It goes back to powershell only if you use powershell commands in the pipeline.

If you don't pass the flags zo handle it as binary in those cases stuff breaks.

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

#340

Earlier quoted context omitted.

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.

I would argue that for scripting portability, this should be the same. With wget equivalent in Powershell being so different for example, scripts that use aliases will be broken. Granted, don't use aliases in scripts and all that.

FWIW, I always thought of it as being for portability of humans, and was very grateful for it on Windows. A large chunk of my time is spent on *NIX systems, so my fingers automatically type "ls" and "rm" instead of "dir" and "del". The fact that Powershell worked, rather than throwing a "eh, what?" error made my time on Windows suprisingly more pleasant.
Post reply on HN