Comparing PowerShell to Linux User Manipulation
-
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
@JaredBusch said in Comparing PowerShell to Linux User Manipulation:
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
Create a New Local User
New-LocalUser salty #PowerShell - super simple, automatically prompts for password
useradd sally #BASH - simple
passwd p@ssw0rd #BASH - simple, insecureWTF? Insecure? Are you fucking stupid?
Also the correct syntax is
passwd salty
and guess what, it prompts you to enter the password.How about that, it is not any different between the two systems.
Shit yeah I did know that.
Still, it's two commands, versus one with PowerShell, unless you write a long one-liner in BASH.
Yes, still two commands. Although the PS one is interactive. Which still sucks, too. In this case, PS is slightly better, I feel, but net user beats either.
-
-
-
Understood, Windows is basically crazy complex and non-standard even within itself and needs special tooling to get to where Linux is out of the box The simple answer is, the best tooling in the world will never fix the underlying complexities baked into the Windows product line and PowerShell is an attempt to make the best of a less than ideal situation. Whereas on Linux the approach has been to take a standard approach whenever possible allowing generic tools to be elegant and effective.
-
Objects certainly have advantages, but text has some whopping advantages, too. Like "what you see is real" rather than "what you see is a representation." It's amazing how much power not abstracting the basic configuration away from the admin provides. Yes, it can make getting specific output parsed a little harder in some cases, but means that the data provided is always parsable. Windows relies on special tools for every task, and if those tools aren't made or have issues, tough. With text interfaces, those problems don't really exist.
-
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
Understood, Windows is basically crazy complex and non-standard even within itself and needs special tooling to get to where Linux is out of the box The simple answer is, the best tooling in the world will never fix the underlying complexities baked into the Windows product line and PowerShell is an attempt to make the best of a less than ideal situation. Whereas on Linux the approach has been to take a standard approach whenever possible allowing generic tools to be elegant and effective.
Exactly.
-
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
Understood, Windows is basically crazy complex and non-standard even within itself and needs special tooling to get to where Linux is out of the box The simple answer is, the best tooling in the world will never fix the underlying complexities baked into the Windows product line and PowerShell is an attempt to make the best of a less than ideal situation. Whereas on Linux the approach has been to take a standard approach whenever possible allowing generic tools to be elegant and effective.
Exactly.
This is why comparing PowerShell to CMD is kind of useful, but comparing to BASH is much lessso. When people look at them, then tend to use PowerShell for Windows tasks and BASH for non-Windows tasks. Which makes sense for usage, but no one is actually comparing PS and BASH, they are comparing Windows and Linux tasks.
PS on Linux works the same as on Windows, but isn't very efficient. It can do essentially anything BASH can do, but is generally slower and more difficult. But on Windows, BASH does haven't the interfaces that PS has, so what it does it does really well, but what it doesn't do is pretty big.
-
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
This is why comparing PowerShell to CMD is kind of useful, but comparing to BASH is much lessso.
This is why I said from the beginning it's not apples to apples between PoSh and Bash.
-
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
This is why I said from the beginning it's not apples to apples between PoSh and Bash.
It can be, though. Because there are times where the shells themselves are what we are comparing. And the discussion I had been having originally, was purely about the shells. Things like startup times and reaction times, for which PS is extremely slow compared to Bash. When you put them into an apples to apples mode, just using them to do things like a remote connection or to run a command, PS is extremely slow. When we are comparing their functionality, they are used for generally very different things. But there are absolutely, like what we were initially discussing, when they are identical and the underlying performance differences are very visible.
-
As far as I know, robocopy is still the best file copying/syncing utility included in Windows, and you have to parse the output to get any anything useful back to work with in Powershell.
^ another example of Windows administration mismatch
-
@flaxking said in Comparing PowerShell to Linux User Manipulation:
As far as I know, robocopy is still the best file copying/syncing utility included in Windows, and you have to parse the output to get any anything useful back to work with in Powershell.
^ another example of Windows administration mismatch
Interesting, so it outputs in text, not objects? Robocopy is definitely the best, never realized that PS didn't fully integrate.
-
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
@flaxking said in Comparing PowerShell to Linux User Manipulation:
As far as I know, robocopy is still the best file copying/syncing utility included in Windows, and you have to parse the output to get any anything useful back to work with in Powershell.
^ another example of Windows administration mismatch
Interesting, so it outputs in text, not objects? Robocopy is definitely the best, never realized that PS didn't fully integrate.
Robocopy isn't PowerShell or a PowerShell cmdlet, function, or module. AFAIK, that's where you get to work with objects.
However, you can really easily parse the output of Robocopy and turn it into a really nice and usable object
-
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
Robocopy isn't PowerShell or a PowerShell cmdlet, function, or module. AFAIK, that's where you get to work with objects.
But wasn't the point that PS was needed to do those things because that is how "Windows" works? If PS only does those things because that is how PS works, then PS is total garbage. It doesn't matter that it isn't part of PS, it's part of Windows, hence should follow the Windows rules.
-
And, likewise, if it is part of Windows, then it is PowerShell's job to interact with it effectively.
-
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
Robocopy isn't PowerShell or a PowerShell cmdlet, function, or module. AFAIK, that's where you get to work with objects.
But wasn't the point that PS was needed to do those things because that is how "Windows" works? If PS only does those things because that is how PS works, then PS is total garbage. It doesn't matter that it isn't part of PS, it's part of Windows, hence should follow the Windows rules.
Maybe you didn't understand.
Robocopy isn't Windows.
Robocopy works great from PowerShell, but Robocopy itself is it's own separate tool in which all logging is text based. It's not at all the same as working with Windows API or an app like Excel...
-
PowerShell has its own way to work with files built in, even though Robocopy is easier to use.
-
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
Maybe you didn't understand.
Robocopy isn't Windows.It is. Robocopy is part of Windows, and a very important part of it. Far moreso part of Windows than say rsync is part of RHEL. Robocopy is made by Microsoft and part of the base of what makes Windows Windows. It is the same or more a part of Windows than PowerShell is.
-
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
PowerShell has its own way to work with files built in, even though Robocopy is easier to use.
That's good that PS has that, but PS is also there to be a part of the Windows ecosystem, not an alternative to it. And PS doesn't really have its own, does it? It's that there are separate tools and PS just works better with those other tools, that likely aren't as good as Robocopy.
Anything in a CmdLet isn't PowerShell, it's another app, just like RoboCopy is. Just one built more with PS being the calling shell in mind, instead of being a more general part of Windows like RoboCopy.
-
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
Maybe you didn't understand.
Robocopy isn't Windows.It is. Robocopy is part of Windows, and a very important part of it. Far moreso part of Windows than say rsync is part of RHEL. Robocopy is made by Microsoft and part of the base of what makes Windows Windows. It is the same or more a part of Windows than PowerShell is.
Robocopy used to not even be included in Windows. Windows was still Windows without Robocopy.
-
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
Robocopy used to not even be included in Windows. Windows was still Windows without Robocopy.
WAS, but IS not. Everything in Windows, including the kernel, didn't used to be there. All of it is new at some point, but together now, that is what Windows is. If you consider Windows only what was included in the original release of Windows NT 3.1, then PowerShell isn't in Windows or even a Windows application as it won't run there.
Robocopy is Windows as much as anything can be Windows. There is nothing today that can be considered "more Windows" than it. Many things are equally Windows, like NTKernel and CMD. Some things you could argue like Notepad are slightly less Windows because they are in the GUI install only, but I'd not think that that makes a lot of sense. But Robocopy is part of every Windows for a long time, and in every configuration.