Live data from Hacker News

Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

news.softpedia.com

251–260 of 350 posts

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

#251

Earlier quoted context omitted.

It is strange to claim no one really uses powershell. It is widely used in the Windows world. The main complaint I see about powershell is that it isn't bash. The object pipeline in powershell can be so much more powerful than parsing text between commands. After all, that's why we have data types instead of storing everything in strings.

It's not widely used in the Windows world from what I can see. Walk into any office and ask an IT guy to run "ipconfig". They'll open up cmd.exe without even thinking about it. I read a lot of programming tutorials. Nobody ever reference PowerShell in them. They always instruct people to open cmd. Do you have any evidence to the contrary?

Why would I run PowerShell for ipconfig? Just do the easiest thing.

Running a multi line script that does nearly anything important? Well yes I am definitely going to use PowerShell.

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

#252
PS is pretty robust, but it's a bit verbose, to say the least.

As noted elsewhere, command processors internals like 'dir' and 'copy' are supported, but aliased to something else. In the case of dir it's aliased to Get-ChildItem, and copy to Copy-Item.

The latter breaks my favourite quick file create method:

C:\temp>copy con example.bat [return] commands go here^Z 1 file(s) copied.

I had a quick look at Copy-Item and there is no obvious way to use it to the same effect that I can see.

[edit: added the [return] to make it more obvious]

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

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

Every windows admin uses it but all the admins I know don't particularly like it or fully understand it. They do like what they can do with it, that they can script almost everything, and it's far better than cmd.exe but honestly the syntax and semantics are pretty baffling.

There's a lot of cargo-cult copy and pasting in the powershell community.

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

#254
post #134

Earlier quoted context omitted.

Most Windows terminal people use ConEmu rather than the inbuilt terminal apps - it's like iTerm2 vs Terminal.app on MacOS. ConEmu adds Unix style cut and paste, tabs, etc. Add openssh, PSReadLine and PSCX and you've got a proper terminal setup. Also MS should really improve the inbuilt apps to do this stuff.

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

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

#256
I'm pretty sure the Softpedia article is incorrect in saying that "cmd" is now aliased to powershell. I installed the update, and running cmd from search bar (win cmd enter) and from run dialog (win+r cmd enter) both launch cmd.exe.

The release announcement post says "Typing “cmd” (or “powershell”) in File Explorer’s address bar will remain a quick way to launch the command shell at that location."

I honestly kind of wish it was aliases - I regularly launch a cmd window due to decades of muscle memory, then remember I really probably wanted powershell.

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

#257
post #95

Earlier quoted context omitted.

It's amazing, isn't it. They went to the effort of building a typed shell but didn't realise there are multiple different types of string. I bet it still truncates output of the ">" operator to the console width, too.

'troll' * 1000 > out.txt Open in NotePad++, no weird newlines in the wrong place, content not truncated. Were you using |format-table and |format-list (ft, fl) to explicitly format the text for console viewing, then redirecting that to a file?

Took a while to reproduce the actual case, and it's Select-String that's at fault. And it must be in "powershell" not "powershell ISE".

  'troll' * 1000 > troll.txt
.. works fine as you say

  Select-String -Path .\troll.txt -Pattern "t" > t.txt
.. wraps the output at the console width. Which means you can't use it as a grep replacement.

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

#258
post #131
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.

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?

You could also previously use the console properties page (accessible from the system menu of the console).

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

#260

Earlier quoted context omitted.

It is strange to claim no one really uses powershell. It is widely used in the Windows world. The main complaint I see about powershell is that it isn't bash. The object pipeline in powershell can be so much more powerful than parsing text between commands. After all, that's why we have data types instead of storing everything in strings.

It's not widely used in the Windows world from what I can see. Walk into any office and ask an IT guy to run "ipconfig". They'll open up cmd.exe without even thinking about it. I read a lot of programming tutorials. Nobody ever reference PowerShell in them. They always instruct people to open cmd. Do you have any evidence to the contrary?

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 to change all of those settings in the GUI."

Maybe it's possible you're not familiar with people who use powershell because you tend to stick to the GUI?

Post reply on HN