Live data from Hacker News

Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

news.softpedia.com

311–320 of 350 posts

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

#311

Earlier quoted context omitted.

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,…

Guess? With naming conventions like "Get-ChildItem"? Major functionality, probably the worst name you could come up with.

A single anecdote doesn't discount a trend.

Being able to predict a PS cmdlet based on patterns works. I know, because I use it daily.

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

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

On a somewhat related note, one of PowerShell's biggest weaknesses is memory utilization. And since they make it so simple to pass around hefty object collections it tends to bite you in the ass early on. Particularly when you're using cmdlets. When doing real scripting that actually needs to be run as a job I am surprised when I can get away with cmdlets and don't need to manage .net APIs/objects directly. Especiall…

That's great advice, man. Cheers.

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

#313

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!

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]

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

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

We are incapable of sustained error. 25+ years was enough. :-)

Jeffrey Snover [MSFT]

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

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

On a somewhat related note, one of PowerShell's biggest weaknesses is memory utilization. And since they make it so simple to pass around hefty object collections it tends to bite you in the ass early on. Particularly when you're using cmdlets. When doing real scripting that actually needs to be run as a job I am surprised when I can get away with cmdlets and don't need to manage .net APIs/objects directly. Especiall…

That is a good tip. There are certain product teams that produced ENORMOUS objects and your suggestion helps when dealing with that.

Jeffrey Snover [MSFT]

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

#316

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've never quite understood the concern about needing to Set-ExecutionPolicy before running scripts.

In Unix, you have to chmod a+x a file before running it. And you have to do it for every script you want to run.

So to run 1 cmdlet to enable all scripts seems a bargain. (Honestly I could be missing something and I probably am because you are not the first person to mention it. I just can't connect the dots.)

Jeffrey Snover [MSFT]

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

#317

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?

Major improvements in V5.

Even more in V5.1 (which ships with WS2016).

But still slower than CMD.

CMD starts very quickly but then you have CMD. :-)

Jeffrey Snover [MSFT]

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

#318

> Microsoft is expected to get rid of [Command Prompt] completely at some point in the future. This is extremely unlikely to ever happen. As long as people have .cmd and .bat files they need to run, cmd.exe will still be around. They're not going to just remove it and break all those scripts.

That is right.

CMD.exe will be around to support script execution for a long long time.

Jeffrey Snover [MSFT]

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

#319
post #88
post #52

Earlier quoted context omitted.

You can, but sometimes the quoting rules differ. For example, bcdedit with its {}-delimited GUIDs breaks in PowerShell without additional quoting, but works fine in cmd.exe. Makes following online instructions tricky if you're not familiar with that nuance.

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.

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

#320

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.

Here is how you do that:

$PSDefaultParameterValues["Out-File:Encoding"]="utf8"

Jeffrey Snover [MSFT]

Post reply on HN