by october_sky · 7y ago · 0 comments
So this starts to potentially make windows an alternative to macOS for developers. I moved to macOS because it was like having a linux/unix distribution that wasn't ugly, and just worked really well.
But I'm more than happy at the _idea_ that there's a viable alternative that allows me to still have high res displays and decent graphics and support, while allowing me to develop on a system that's a first-class citizen for most open source tools (which is Linux).
My impression is just as anecdotal as yours, but it's exactly the opposite. Windows seems to me to be gaining amongst developers, due to a combination of push and pull factors (respectively: Apple's declining hardware and Microsoft's improving software).
I'm a case in point: a few years ago I wouldn't have considered running Windows, but I was driven to trying it in 2018 by Apple no longer making any notebook hardware I was willing to use. Admittedly I'm now largely on Linux, but it's a close call between the two and I could be tempted back.
Not sure what you mean. Windows has been using PowerShell for almost a decade now as the Bash equivalent "everything at your fingertips" command line tool.
Personal opinion, in many ways PowerShell is more powerful than Bash. It's more verbose, but it's also easier to script.
Its designed to be integrated into everything. When my sysadmin GUI clicks vmWare I open PowerCLI. When my db admin uses networker for backup I use Sql Server Powershell Module. When my web dude clicks in IIS management studio and forgets the click I give him unmistakable ps1 script that crates IIS site and sets it up in 5 lines of code. Its like that forever.
Poweshell is no typical shell - u do business stuff in it, not text parsing all the time like in bash with 0.1% of what you actually want to do.
The thing that i personally miss is exporting config of Windows (control panel and friends) as powershell script(s). Something like DSC (or better, BoxStarter) but for grannies - press Start -> export everything to powershell script -> reinstall -> run ps1 -> run chocolatey -> show FTW sign.
But it isn't. Try managing AD servers using powershell. You have two options. Either the powershell AD module, which is incomplete and doesn't cover the entirety of Active Directory, or you resort to the native .Net API which is ugly and unintuitive when used from a command line.
"When my db admin uses networker for backup I use Sql Server Powershell Module."
Wut? Don't do this. I've used that module and it's fragile as hell. You have to check the arity of your select statements for it to work correctly. I built a data importation integration using it once and once I got tired of it breaking I just caved and rewrote the tool in C# and never had any more trouble.
But none of that's what I'm talking about when I say that it feels like a second class citizen. If you're on a Unixy machine, every tool implicitly runs from within a shell. That means the shell is always available, even from an application. Not so with Windows. In Windows, the .NET API is your world ( or if you're unlucky, the Win32 API) on Linux, it's the shell.
It's kind of in this sense that Powershell isn't really a shell in the sense that Bash is the primary interface to the operating system whereas Powershell is just an interface layered onto other interfaces. I've done enough sysadmin type work in either environment to feel the difference. Powershell is less a primary interface with the system and more a scripting language. As a scripting language, it's pretty fine, I have no complaints about the design. I'd like to think it's pretty close to what I would have come up with had I been tasked to design a CLI for Windows in the mid 2000s, but it doesn't underly the system as deeply as the Unix shells do.
Edit:
For an great concrete example, compare Cron with the Windows Task Scheduler. With Cron, the command language is whatever your shell happens to be. You have a string which specifies the schedule, followed by some shell command which does your task. The shell command can launch a program, start another script, or you might be able to contain it all in the single line. On Windows, you provide the exact path to the program you want to launch and any arguments. That's it. Powershell isn't available. If you want to launch a PoSH script, you have to reference the PoSH executable and provide your script as an argument. It's relatively ugly.
One nice thing about the Cron approach, is that you can provide input redirection for ad-hoc logging or even output suppression, without having to modify your executable. It's a lot more steps to do the same thing on Windows.
It's not free of warts (the verbosity is annoying), but I personally find it much more readable than Bash scripts. The support for script modules also helps a lot if you are managing a lot of scripts.
https://docs.microsoft.com/en-us/powershell/scripting/instal...