4 ms·
Sorry to piggyback on this post: I have to use Windows at work, and do not know Powershell. Several times I've debated learning it, but never put in the effort
by BeetleB 10y ago
Sorry to piggyback on this post:
I have to use Windows at work, and do not know Powershell. Several times I've debated learning it, but never put in the effort.
Now I use Xonsh (http://xon.sh/ http://xon.sh/). It is a Python shell - cross platform and similar semantics to bash, etc. I was never a power bash/zsh user (scripting in them is Hell). The nice thing with xonsh is that it is Python. If you want to customize your environment, have complex aliases - well, you just write Python code in your config file.
Learning PowerShell for Windows is the ideal. But xonsh is a good intermediate solution for people who don't want to invest in going all the way.
(To be honest, I'm seriously considering switching to xonsh for my Linux machine - currently I use zsh).
- YeGoblynQueenne 10y agoxonsh looks interesting. My first question would be along the lines of "do you get command completion and nice syntax highlighting in the shell?" but I see in your link that it does have those, so that's a great start. My other worry is that there's going to be some things it's hard to do _on windows_ for any shell that isn't created by microsoft. Which is not the fault of xonsh, or any other alternative shell, obviously- but which might make psh a better deal in some cases. Can't think of an example though, to be honest :)
- quanticle 10y agoxonsh might be fine for interactive use, but I'd hesitate to use it for serious scripting. The nice thing about PowerShell is that it's a .Net CLR language. So, this means that anything that's accessible to .Net (including COM bindings) is also accessible to PowerShell. This means that for example, you can script IIS configuration and setup with PowerShell. You can script things like importing certificates. You can stop and restart Windows services. I'd be surprised if xonsh exposed the same amount of the Windows API as PowerShell.
- chris_wot 10y agoWith a bit of pinvoke goodness you can load unmanaged dlls also.
- BeetleB 10y agoOh, for sure. xonsh is nowhere near as powerful as PowerShell. I was pointing out that xonsh is a good shell for people who do not want to learn Powershell: people who do not need all the power. I work on Windows, but I'm not a Windows developer. I do embedded programming, and so am not familiar with most of .Net/COM. I just need to do my work on Windows, and for people coming from the UNIX world, xonsh is a shell that makes life tolerable with minimal learning necessary. Obviously, Powershell is better, but requires a lot more investment.
- majkinetor 10y agoI was totally entusiastic when you mentioned this so I went to read the docs. While it does seem way "shellier" then pure python I don't think its comparable to Powershell. One of the main benefits of posh is that it provides standards on arguments so that discoverability is easy. Along with that you get automatic tab completition for everything, module autoloading and nice stuff such as proxy commands, JEA and other great stuff not avaialble in alternatives. The other one is that nowdays many tools expose automation via powershell modules - sql server, visual svn, chocoalatey, vmware, etc. just to name few - so all that power seems wasted with xonsh on Windows. Not to mention wmi, COM and other nastier stuff becomes way more problematic then it needs to be. Good luck driving Excel for example. There was similar attempt with Ruby (https://github.com/adamwiggins/rush https://github.com/adamwiggins/rush) - but it failed because you do really need a special language for shell. Its pitty Xiki (http://xiki.org/ http://xiki.org/) didn't become mainstream talking about Ruby. Whitespace semantics also look like troublesome in the shell context and I guess in some more serious usage ambigious stuff like ls -l may become problematic and hard to detect source of bugs. On the other hand, it rewards with better Python knowledge which is always good.
- BeetleB 10y ago>While it does seem way "shellier" then pure python I don't think its comparable to Powershell. Well, none of the UNIX shells are comparable to Powershell. That's why this is a nice in-between solution. A way to have a UNIX like shell on Windows, without the need to learn a new language if you already know Python. >Whitespace semantics also look like troublesome in the shell context and I guess in some more serious usage ambigious stuff like ls -l may become problematic and hard to detect source of bugs. Been using it for a few months. So far, not a problem. The biggest headache is that "dir" is a reserved keyword in Python. Not a problem: I just made 'ls' an alias for it. The only real problem is that Windows has case-insensitive environment variables, but xonsh makes them case-sensitive. This is fixable, and they'll probably fix it some time soon.
- majkinetor 10y ago> Well, none of the UNIX shells are comparable to Powershell. Yes there is one, Powershell :) Thx for detailed report by the way. I hope the project will get mature and adopted.