Windows Powershell in Ubuntu 18.04 software center?

It’s too bad. PoSH has some innovative features.

1 Like

So does Linux and the myriad of command lines on offer.

And plus it is Linux! If people want the features of power shell then they will be created native.

1 Like

Yes.

As many people have said this is for systems engineers, developers, R&D professionals, etc. that manage Windows infrastructure with Linux hosts.

That being said, @thro already bought it up, PowerShell scales in ways that are difficult to imagine without watching it. It will out perform bash when it matters most. This isn’t a pissing contest, this is just the reality and difference of the two systems. Bash interfaces with text, PowerShell interfaces with objects . When deploying software, infrastructure, configuration management, or migrations/change management that is an enormous difference. You’re not just slapping duct tape on a problem you’re creating infrastructure as code.

Anything you do on a modern Windows environment is PowerShell on the backend. You point and click to create a domain controller, DHCP server, file server, Exchange server, etc. all those clicks are calling PowerShell in the backend. You ever see PowerShell disabled at an organization for “”“security”"" purposes? Nothing works, because it’s involved in the Windows backend.

You can create PowerShell functionality in C#, and people do this with custom tooling or in-house development. Build Engineers/Release Engineers in a .NET world rely on PowerShell to push CD/CI changes or deploy new stacks. Database administrators can gain performance utilization and tune up their databases with DBATools and other PowerShell features. Developers can use PowerShell to call native Windows functions when building or testing a desktop application. Systems engineers can use PowerShell to, well, engineer systems.

Power users can use PowerShell to perform backups, copy drives, copy files, change/force group policies, make administrative changes, etc. Everything you can do in a Linux CLI you can do in PowerShell. That doesn’t mean sudo apt grep vim emacs -yf upgdate is going to work, because none of that is relevant in PowerShell. But the functionality translates well, you just have to learn the syntax.

PowerShell isn’t Bash. No one ever said it was. I don’t know why people try to turn PowerShell into Bash and then complain about it (not saying that’s what the person I quoted is doing). But the question always comes up is “What would I ever use PowerShell for?” and the answer is always: “Everything”. If you don’t have a use case you don’t have a use case, that doesn’t make it worthless to the millions of people benefiting from it every day.

5 Likes

Ok. Disregard the scale argument for a minute – I don’t want to scale anything and there are use cases that don’t require scale. Consider that PowerShell is meant for scripting and an interactive command line. That feels like a bash substitute to me, it is essentially the Linux MO. If I interacted daily with a Windows workstation, I would think that I would get most out of it on the command line within PowerShell. Yes?

I feel like all you’re saying here is “PowerShell is trying to be Bash” – It’s not. I don’t understand your last question, either. No one is saying not to use PowerShell to interact with Windows. Quite the opposite.

Also, there are a ton of other use cases that don’t involve scaling that make PowerShell useful (listed above with the devs and other non-scaley :snake: stuff lol).

So, to answer your question, yes. You can use PowerShell to interact with Windows.

2 Likes

I’m clueless, I’m grateful for your patience…

I’m trying to find if anyone actually does use it as a bash substitute. I know it can be used that way and I tried to do that, but I didn’t find a case under Linux where the interactive command line is as powerful as other shells. I thought at the time that Linux is the odd duck here, if I was under Windows, all of the contributions and integrations would work.

It looks like most people use it as a python substitute, not a bash substitute, even under Windows.

1 Like

OH, I understand what you’re saying now (I think lol).

You’re interested and attempting to have a better understanding. A+ in my book.

Yes, you can use PowerShell on Windows in the way that people use Bash on Linux. However, and this goes along with the “learning the syntax” comment I made earlier, PowerShell is incredibly verbose. So, while you can accomplish the same things, generally, it’s going to look more like code than Bash does.

But yeah, you can use PowerShell like people use Bash. It’ll look different, but it’ll accomplish the same results.

Funny, I had a guide that I used when I first started learning PowerShell that really helped with people coming from Linux. I’ll see if I can find it. It’s kind of old, but relevant still.

Edit

Found it:

This guy really knows his stuff, I had this bookmarked for months.

It is worth noting that Linux uses “PowerShell-Core”, which is a striped down (for now) version of PowerShell. Fundamentally, it is the same thing. However, it will lack a lot of the useful modules that make PowerShell versatile on a Windows environment.

2 Likes

Not really.

go learn powershell.

Forget that it is microsoft technology and approach it with an open mind. it WILL mindfuck you for a bit (because as above it is an OBJECT pipeline, not a text pipeline, so you need to adjust your brain to that way of functioning), but there’s a LOT to like in powershell that the unix community needs to stop poo-pooing just because it came out of redmond. Even a broken clock is right twice a day and Powershell is an example of one of those things Microsoft has done that doesn’t suck.

Until you see some of the things that powershell can do AT SCALE you really have no idea. And this isn’t with hacks like setting up pipes into and out of remote sessions via SSH. It does this stuff natively.

Essentially any Windows WMI object can be messed with in powershell pretty much directly. At scale. with a simple foreach loop…

Linux doesn’t even have a standard interface like WMI to do any of this stuff with…

i mean i can do something like (this might not be exact as its been a little while and i’m a bit rusty and writing off top of my head)

$PCs = get-adcomputer
foreach ($pc in $PCs) {
 get-wmiobject win32_bios -computername $pc
}

to get the BIOS information from every PC on the domain…

try that with bash under linux.

Even without the scaling requirement, powershell can do so much more than bash can in a standard way - because it can interact directly with WMI, has built in remoting, code signing, etc.

Want to stop powershell malware on your box (or even more dangerous, inexperienced admins messing with your script and running it on every PC on the domain)? Want to ensure that only the legit version of your script runs? Enforce code signing on powershell scripts and you can. Dev/test your script, then code sign it and deploy to production. If anyone fucks with it, it won’t run any more until you vet/sign it.

2 Likes