Live data from Hacker News

Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

news.softpedia.com

81–90 of 350 posts

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

#81
post #60
post #11

So basically instead of doing dir C:\ I have to learn to type List-Directory-With-Files Drive=C Folder=/ (made up example, but you get the point)

Being verbose would be a good thing (more readable than a cryptic acronym) if there was auto-complete support. A console should really be a small IDE that gives live feedback on what arguments are possible in the current context, etc. But that's not the way powershell was designed.

There is auto-complete support. I just tested it (not a powershell user myself), and it seems pretty intelligent.

For example, if you type

    dir | sort 
it suggests Attributes, BaseName, CreationTime, .... All properties of file objects (which is what dir returns).

Also there is PowerShell ISE, which is a IDE for powershell, but I haven't really tried it yet.

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

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

also CTRL+V pastes by default now, but yea you're no longer locked into half the screen by default. I wonder why that's been like that for so long? Must be some reason...

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

#83
post #58
post #35

Something that irks me is how PowerShell’s default aliases take precedence over binaries in the PATH. To be able to use the GNU utils, you have to put this in your profile.ps1 : Remove-Item Alias:cat Remove-Item Alias:cp Remove-Item Alias:curl Remove-Item Alias:echo Remove-Item Alias:ls Remove-Item Alias:man Remove-Item Alias:mv Remove-Item Alias:pwd Remove-Item Alias:rm Remove-Item Alias:wget

Isn't that always the case, that shell built-ins take precedence over things elsewhere in the system? On Unix you have to call them with their full path, e.g. to get the system echo instead of bash's you need /bin/echo, I guess. On Windows you can add the extension, i.e. use ls.exe instead. Even cmd shadows programs that have the same name as a built-in, e.g. echo.exe must be called as such and just echo will use the…

That is correct. Most people do not notice because the buildings in bash are almost completely equivalent to the standalone binaries.

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

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

I've been able to do that in versions of Windows going back as far as I can remember.

Older versions could resize the window with a drag, but the underlying buffer required a menu option, which was very awkward.

In Win10, you can resize the buffer with a drag as well.

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

#85
post #22

Earlier quoted context omitted.

PowerShell is fully backwards compatible with cmd. Try again.

No, it's not. PowerShell has aliases like 'dir' and so forth, but it's definitely not compatible. This will break a bunch of legacy stuff. That stuff probably deserves to be broken; the cmd.exe syntax has always been pretty disgusting.

It's not compatible at the syntax level, but it will also not break anything either. Batch files written for CMD will still be executed by CMD, not PowerShell. Unless you have an application that prompts the user to open a command prompt and then send keystrokes there to run commands, nothing will be broken here.

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

#86
post #26

Earlier quoted context omitted.

Sure, go ahead, ruin my joke :) More seriously, how many seconds did it took for the PS to answer to that command?

Measure-Command {dir C:\} TotalMilliseconds : 2.9708 Measure-Command {Get-ChildItem "C:\"} TotalMilliseconds : 2.4161

Compare it with cmd.exe's dir

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

#87
post #53

By the way, where does the capitalized kebab case come from? Prior art or just Microsofts general hankering for capitalization (e.g. C#s Class.DoSomething() vs Java's Class.doSomething())?

What you're thinking of is PascalCase https://en.m.wikipedia.org/wiki/PascalCase

Your parent probably meant Kebab as in the dash (skewer-stick) between words.

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

#88
post #52

Earlier quoted context omitted.

You can run any command from CMD in Powershell

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.

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

#89

Just another reason to stay away from Windows as a platform. Windows 10 is a moving target if you are trying to work with it.

How is that any different from Linux distributions camping their default shell? Like back when debian changed their default shell to dash I don't remember anyone saying you should stay away from debian, even though it broke a lot of existing scripts.

Debian didn't make a major change within a release.

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

#90

Earlier quoted context omitted.

You can run any command from CMD in Powershell

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…

Talkkill seems like a very useful feature to me ;)
Post reply on HN