Live data from Hacker News

Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

news.softpedia.com

141–150 of 350 posts

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

#141

Earlier quoted context omitted.

Wait, the Linux subsystem on Windows inherits that stupid convention of deciding if a file is executable by its name?

No, Windows does not decide whether files are executable by looking at their name.

Windows just failed on running my text file because it didn't have the correct header.

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

#142

Earlier quoted context omitted.

That's indeed nice. I wonder if there is something like that for ZSH.

I don't know for sure about ZSH and can't test it at the moment, but Bash has -- for this purpose. It may work in ZSH as well.

Isn't the -- a feature of the command to stop option parsing and treat the remaining arguments as file names? AFAIK it's not a shell feature that solves quoting (and it's not that easy on Unix either, since running a program involves argument parsing instead of just passing a string).

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

#143
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)

Add posh-HumpCompletion https://github.com/stuartleeks/posh-HumpCompletion then you just need to type first Caps and hit tab

You can do the same thing with PSReadline, which is included in Win 10 installs.

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

#144
post #134
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.

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.

Whilst I am glad to hear about ConEmu; I have to disagree, I use windows cmd.exe very regularly, and know lots of other people that do, and I have never used ConEmu before! I might give it a try now I know about it.

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

#145
post #95

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

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.

this ^^^

This is the main reason I still use cmd.exe

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

#146
post #126
post #114

Earlier quoted context omitted.

That's not what I mean by autocomplete. What I mean is more like Visual Studio's intellisense, ie a drop down that lets you know what are all the options from there. You can type DIR , that won't tell you that you can apply the parameters "/p" or "/w" nor what these parameters mean. ISE does a slightly better job but is based on a static specs, rather than the current state of the system. So it won't list the VM name…

If you type: dir - PowerShell will list all available parameters below, and allow you to tab through them. The tab completion is not static either. If you type: ps , it will tab through all the current processes.

I you type "Start-VM -name ", it won't list the list of the VMs, but rather the list of the files in the current directory. That's not exactly what I would call insightful.

I didn't know about the CTR+SPACE. That being said it doesn't seem much more insightful than TAB. And no description of what the argument does.

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

#147

Earlier quoted context omitted.

Wait, the Linux subsystem on Windows inherits that stupid convention of deciding if a file is executable by its name?

No, this is in powershell not the linux subsystem. In powershell they defined a bunch of aliases to internal powershell functions like cp, mv, cat ... that don't work like the original unix version. If you install the GNU version on the system and try to use them in powershell that won't work by default. You either remove the alias or use the trick above to force powershell to use the .exe of the utility.

Oh, ok. That was GNU tools compiled for Windows, not the Linux subsystem. I was surprised for a while, but yes, I shouldn't.

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

#148
post #30

Earlier quoted context omitted.

At least Powershell has Unixy aliases for the common commands. I don't know how many times I've been in a cmd shell and typed ls and then swore at things.

I just wrote batch files that serve as aliases for those. I type ls in my command shell and it does a dir /w behind the scenes, which makes it look more like how it looks in Linux anyway. Here are the ones I have: * cat.bat: type %1 * clear.bat: cls * diff.bat: fc /n /w %1 %2 * ls.bat: dir /w %1% * pwd.bat: cd * touch.bat: echo . >> %1 * top.bat: tasklist All have an @echo off at the top too. Touch is a little janky,…

I just install Gow.

https://github.com/bmatzelle/gow

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

#149

How does PS compare to installing cygwyn and using bash ? (from a Linux user perspective) does it support grep, find, ls, PS, pipes, etc?

better?

with PS you pipe objects. The pipeline is very much the way to move data between cmdlets.

each of the linux commands you listed has an equivalent PS cmdlet.

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

#150
post #120
post #100

Earlier quoted context omitted.

Agreed. I like PS too but forcing it breaks a lot of staff, you cant use it interchangeably, eg 2 quickies: -bcdedit /c {xxxx-xxx-xxx-xxx} (= {..} is parsed as a code block) -invoking executables with spaces in path

bcdedit --% /c {xxxx-xxx-xxx-xxx} & 'C:\Program Files\Foo\Foo.exe'

I know, you could also just put {} around quotation marks and would work. My and parent's point was that it will probably flood MS's support channels, if you just force every cmd user into PS.
Post reply on HN