Live data from Hacker News

Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

news.softpedia.com

321–330 of 350 posts

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

#321

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…

My problem with the Execution Policy is that it's useless in practice since it doesn't actually prevent anything (so it annoys me every time). What was the motivation for adding it since it's not a real security feature? If it actually prevented executing stuff full stop it would be cool. The signed script concept is cool... I wish I could do that with Python.

Was it just to prevent accidental script execution?

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

#322
post #183
post #75

Earlier quoted context omitted.

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"

The idea that the console screen is an MxN matrix is pretty embedded in the API... it's not a MDA display adapter metaphor, not a Unix-style typewriter. I'm guessing they just felt they had bigger fish to fry. (Everybody I know that uses the console window a lot has always just set the window to 120x9999 or 160x9999 or whatever and forgotten about it. It's one of those things that's obviously kind of lame, but after…

Odd, I've always set it to 132.

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

#323

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…

I think the problem is that when you chmod a file it stays chmoded. With the Set-ExecutionPolicy I find that I have to do it every time I start a shell. I also run a lot of headless scripts (AWS cloud-init, services, etc.) and it's always a pain resetting everything every time. With Unix, I know that a script is executable or not, with PS I don't.

Also, I might not want every script to be executable. With Unix I can choose which ones are executable and by whom. With PS it's all or nothing. :/

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

#325
post #16

Hopefully one day Bash will be the default Windows CLI.

That was the approach I took before inventing PowerShell. We didn't WANT to invent a shell - we were forced into it.

The problem was that Bash on Windows wasn't effective. At the heart of the matter is the difference in architecture between Unix and Windows. In Unix, most everything is a file so if you can modify files and restart processes, you can manage everything. In Windows, most everything is an API so tools that manipulate files don't do much for you.

Ergo - we needed an admin automation model which supported an API oriented architecture. Thus PowerShell.

NOTE - Bash on Windows today has a very different focus - it is not about managing Windows (which it still doesn't do) - it is about using OSS tools to develop OSS Software. It does a great job at that.

Jeffrey Snover [MSFT]

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

#326

Earlier quoted context omitted.

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…

I think the problem is that when you chmod a file it stays chmoded. With the Set-ExecutionPolicy I find that I have to do it every time I start a shell. I also run a lot of headless scripts (AWS cloud-init, services, etc.) and it's always a pain resetting everything every time. With Unix, I know that a script is executable or not, with PS I don't. Also, I might not want every script to be executable. With Unix I can…

Yikes! - you shouldn't have to do Set-ExecutionPolicy every time you start a shell. Something is definitely wrong there.

Try doing a: Get-ExecutionPolicy -List to see what is setting it.

Then use -SCOPE on Set-ExecutionPolicy.

BTW - I hear you on the "only chmod the scripts you want" - that is a nice benefit of the Unix model.

Jeffrey Snover [MSFT]

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

#327

Earlier quoted context omitted.

That's all correct and it is the right way to do things (especially from Microsoft's perspective). However, the main goal of Powershell seems to be providing a scripting language that can automate Windows internals and not a shell in which you live in. Powershell is just a nice REPL, not so much a shell as you might be used from Bash. We have had Powershell for 10 years now. Has it taken off in a big way? No. The adm…

I wouldn't take out bash or zsh or whatever else to do a project either. But I do use it when I want to run a bunch of cmdline tools. Right tool for the job and all...

I compared Powershell to Python regarding projects, not Bash.

It could have been 1. a shell 2. an automation tool 3. a scripting language, yet it fails at 1., is ignored regarding 3., and only succeds at 2.

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

#328

Earlier quoted context omitted.

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…

My problem with the Execution Policy is that it's useless in practice since it doesn't actually prevent anything (so it annoys me every time). What was the motivation for adding it since it's not a real security feature? If it actually prevented executing stuff full stop it would be cool. The signed script concept is cool... I wish I could do that with Python. Was it just to prevent accidental script execution?

That is correct (prevent accidental script execution).

It is ABSOLUTELY NOT a security mechanism. That is why we we support this:

Set-ExecutionPolicy -ExecutionPolicy Bypass

I wanted to make it:

Set-ExecutionPolicy -ExecutionPolicy DoAnythingBecauseTExecutionPolicyIsNOTASecurityFeature

But the team didn't like that. (I should have overruled them on that one :-) ).

Jeffrey Snover [MSFT]

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

#330
post #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.

So no Ctrl+C to bail out of apps? Is there an equivalent?
Post reply on HN