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.
Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
141–150 of 350 posts
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#142Earlier 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.
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#143So 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
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#144Btw 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.
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#145That'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 is the main reason I still use cmd.exe
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#146Earlier 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 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
#147Earlier 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.
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#148Earlier 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,…
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#149How does PS compare to installing cygwyn and using bash ? (from a Linux user perspective) does it support grep, find, ls, PS, pipes, etc?
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
#150Earlier 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'