Live data from Hacker News

Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

news.softpedia.com

51–60 of 350 posts

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

#52
post #3

"Typing cmd in the run dialog will launch PowerShell as well" What? I'm a big PowerShell fan, but I see the need to keep cmd around for a while. Clobbering it before it's phased out seems problematic.

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.

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

#54

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?

That's my biggest concern, I actively avoid PS just because I can't tolerate its startup time.

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

#56
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

There are use-cases where globally removing aliases isn't an option (e.g. scripting for use on a machine that isn't yours).

For those, it's also possible to evade the aliasing just by explicitly appending the .exe onto the command. 'pwd.exe' gets you the GNU version.

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

#57
post #47
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

How would an alias work otherwise? That's pretty much the way it behaves in Unix, too (e.g. 'ls' in most default configs). Although I'd still consider curl/wget to be specific tools and not generic commands, so emulating them seems a bit weird.

The point is that they're defined by default. See this story for more background:

https://news.ycombinator.com/item?id=12319670

Edit: the RFC intended to address the curl author's issue was rejected.

https://github.com/PowerShell/PowerShell-RFC/blob/master/X-R...

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

#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 built-in command.

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

#59

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

Haven't tried in the preview build but this is still the case in the recent Windows 10 build I have.

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

#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.
Post reply on HN