Bash is so much easier. Trying to learn PowerShell is like trying to learn Tibetan, it's excessively complex and only works in one place anyway.
Give me a one-liner that gives me an overview of all running services of two remote machines, and has a GUI that allows me to filter on startup type. The output has to be in a HTML table. You have 3 minutes.
Under a minute:
Get-Service -ComputerName PC1, PC2 | Where-Object {$_.Status -eq "Running"} | ConvertTo-Html | Out-File out.htm
Now show me the Bash version.
2 years ago
Anonymous
So it's like scripting with millions of random packages you might use sometime built in, huh
2 years ago
Anonymous
It's the entire .NET environment which integrates with pretty much all Microsoft software. This makes it extremely helpful for sys admins. Bash is just a shell with zero understanding of any software.
2 years ago
Anonymous
The trick for any sysadmin is not having any windows machines.
2 years ago
Anonymous
teach me the secrets, master
2 years ago
Anonymous
Why bother with powershell at that point? C# has an actual IDE, debugger and a sane syntax
2 years ago
Anonymous
Because it's easy. PowerShell also has several IDEs and a debugger.
People with jobs use powershell, so slash gee hates it.
The trick for any sysadmin is not having any windows machines.
I'm mostly a Linux admin. PowerShell is the one thing I miss. And no, Python doesn't come close.
okay so
systemctl list-units --type=service >pc1.log
then ssh into the second computer
systemctl list-units --type=service >pc2.log
then
scp pc2.log [email protected]/home/Documents
or something like that
now grab those commands and turn them into a script and voila run them whenever >but its not html
well thats where python or perl comes in handy
2 years ago
Anonymous
try pandoc
also you can run a command on a remote machine over ssh, the output is piped to stderr and stdout, i think it's -c 'sudo systemctl w/e'
There is no manual to read. On FreeBSD I can do "man sh" and read it top to bottom and know sh.
You can't do that on Windows. PowerShell's basic functionality is spread across so many Get-Help pages and there's no clear order to read them in.
i can not comprehend how powershell is so overengineered
it has all of this object orientation, C# interop, complex APIs with 20 different named parameters... but for what?
why does a shell scripting language have the ability to compile C# code and use it? why can it load a dll?? just what purpose was powershell built for?
its like if bash could import java class files and then call its functions directly
No, you've just been given brain damage by bash and unix shells in general. Everything is so crystal clear in naming and functionality.
>only works in one place anyway.
PowerShell is on all major operating systems.
i can not comprehend how powershell is so overengineered
it has all of this object orientation, C# interop, complex APIs with 20 different named parameters... but for what?
why does a shell scripting language have the ability to compile C# code and use it? why can it load a dll?? just what purpose was powershell built for?
its like if bash could import java class files and then call its functions directly
>it has all of this object orientation, C# interop, complex APIs with 20 different named parameters... but for what?
Because Windows needed something better than shitty text manipulation shells >In a 2017 interview, Snover explains the genesis of PowerShell, saying that he had been trying to make Unix tools available on Windows, which didn't work due to "core architectural difference[s] between Windows and Linux". Specifically, he noted that Linux considers everything an ASCII text file, whereas Windows considers everything an "API that returns structured data". They were fundamentally incompatible, which led him to take a different approach.
https://en.wikipedia.org/wiki/PowerShell#Background
>its like if bash could import java class files and then call its functions directly
You guys use jq(1) all over the place anyway because its useful? and then shit on powershell while using fricking JSON (my sides) to get the same functionality.
i dont really care about the ins and outs of powershell. What i care about is that i be able to install and run stuff on it. And a lot of the time it wont run when it does install.
I always start out with powershell and end up on wsl.
>And a lot of the time it wont run when it does install
That’s because you insist on using malformed install scripts made by people that don’t know what they’re doing, so you assume when chocolatey fails to add something to your path this is somehow powershell’s fault. Amazing.
what is your point? that you have installed cmake somewhere where chocolatey expects it, while not having it in the path so powershell does not find it?
>PATH variable is messed up >Powershell in unusable
you would have the same problem on linux if you compiled and installed something in a directory not in your path
people who don't know about every tool are much easier to deal with than people who autistically make a certain tool a part of their personality. >heh, you use a carpentry hammer? Imagine that, I exclusively use ball-peen hammers. Frickin pleb
Wtf are you talking about I’m trying to help you stop shooting yourself in the foot. Alternatively stop using these dogshit install scripts written by teenagers altogether and acting surprised when something goes wrong.
I'm starting to believe giving candidates an interview task using powershell would be a great way to filter out poor candidates. PS seems to be great at filtering brianlettes and those that just refuse to learn
Thanks copied those on my phone. Will check to see if they work tomorrow
for server in servers_here; do ssh "$server" 'printf "%s\n----n" "$(hostname)"; systemd-analyze blame'; done | ansi2html
Black person.
That's clever but why does it all have to be in one line anyways?
See the other guy says that the kernel is the reason PowerShell is messed up when that one line inclination, or whatchamu call it, is clearly a design desicion. I don't know, my understanding is that this shell stuff is a C wrapper so they could design any way they want.
>That's clever but why does it all have to be in one line anyways?
it doesn't.... honestly doesn't even do what he wanted but whatever. his ask was gay as frick.
I usually write shit with multiple newlines and use long opts.
Agreed, it boggles my mind that people make a living scripting for that environment
Give me a one-liner that gives me an overview of all running services of two remote machines, and has a GUI that allows me to filter on startup type. The output has to be in a HTML table. You have 3 minutes.
No frick off
Bash is supposed to be easy. So show me. Let's also simplify it; you don't have to give me a GUI.
Show me the PowerShell first
You have to show us first ya goof
Under a minute:
Get-Service -ComputerName PC1, PC2 | Where-Object {$_.Status -eq "Running"} | ConvertTo-Html | Out-File out.htm
Now show me the Bash version.
So it's like scripting with millions of random packages you might use sometime built in, huh
It's the entire .NET environment which integrates with pretty much all Microsoft software. This makes it extremely helpful for sys admins. Bash is just a shell with zero understanding of any software.
The trick for any sysadmin is not having any windows machines.
teach me the secrets, master
Why bother with powershell at that point? C# has an actual IDE, debugger and a sane syntax
Because it's easy. PowerShell also has several IDEs and a debugger.
I'm mostly a Linux admin. PowerShell is the one thing I miss. And no, Python doesn't come close.
PowerShell runs on linux, you know...
PSH for Linux and macOS is a fricking joke
>Microsoft software
In the recycle bin it goes
>IQfy neets can’t show a bash equivalent.
Sad!
grep systemctl something something
okay so
systemctl list-units --type=service >pc1.log
then ssh into the second computer
systemctl list-units --type=service >pc2.log
then
scp pc2.log [email protected]/home/Documents
or something like that
now grab those commands and turn them into a script and voila run them whenever
>but its not html
well thats where python or perl comes in handy
try pandoc
also you can run a command on a remote machine over ssh, the output is piped to stderr and stdout, i think it's -c 'sudo systemctl w/e'
but why would you anything output in HTML?
systemctl --type=service --state=running | ansi2html | out.htm
> | out.htm
lol
for server in servers_here; do ssh "$server" 'printf "%s\n----n" "$(hostname)"; systemd-analyze blame'; done | ansi2html
Black person.
You're supposed to first show how you do it on PowerShell, and THEN someone will reply with a bash version
it's pretty good once you rtfm
There is no manual to read. On FreeBSD I can do "man sh" and read it top to bottom and know sh.
You can't do that on Windows. PowerShell's basic functionality is spread across so many Get-Help pages and there's no clear order to read them in.
What are the Microsoft documentation pages?
Ain't nothin' new under the sun
D- HAHAHAHAHAHAHAHAHA
https://www.codefactor.io/repository/github/powershell/powershell
Bash is so much easier. Trying to learn PowerShell is like trying to learn Tibetan, it's excessively complex and only works in one place anyway.
i can not comprehend how powershell is so overengineered
it has all of this object orientation, C# interop, complex APIs with 20 different named parameters... but for what?
why does a shell scripting language have the ability to compile C# code and use it? why can it load a dll?? just what purpose was powershell built for?
its like if bash could import java class files and then call its functions directly
>why can it load a dll?
Can't ksh93 (genuine Korn Shell) load the Unix equivalent of DLLs?
https://github.com/taviso/ctypes.sh
No, you've just been given brain damage by bash and unix shells in general. Everything is so crystal clear in naming and functionality.
>only works in one place anyway.
PowerShell is on all major operating systems.
>it has all of this object orientation, C# interop, complex APIs with 20 different named parameters... but for what?
Because Windows needed something better than shitty text manipulation shells
>In a 2017 interview, Snover explains the genesis of PowerShell, saying that he had been trying to make Unix tools available on Windows, which didn't work due to "core architectural difference[s] between Windows and Linux". Specifically, he noted that Linux considers everything an ASCII text file, whereas Windows considers everything an "API that returns structured data". They were fundamentally incompatible, which led him to take a different approach.
https://en.wikipedia.org/wiki/PowerShell#Background
>its like if bash could import java class files and then call its functions directly
You guys use jq(1) all over the place anyway because its useful? and then shit on powershell while using fricking JSON (my sides) to get the same functionality.
i dont really care about the ins and outs of powershell. What i care about is that i be able to install and run stuff on it. And a lot of the time it wont run when it does install.
I always start out with powershell and end up on wsl.
>And a lot of the time it wont run when it does install
That’s because you insist on using malformed install scripts made by people that don’t know what they’re doing, so you assume when chocolatey fails to add something to your path this is somehow powershell’s fault. Amazing.
>Too lazy to learn a new tool
>Refuses to understand the reasons for its existence and design
>Claims it's bad
Ignorance is not a fricking virtue.
what is your point? that you have installed cmake somewhere where chocolatey expects it, while not having it in the path so powershell does not find it?
powershell is pretty bad but not for that reason
>PATH variable is messed up
>Powershell in unusable
you would have the same problem on linux if you compiled and installed something in a directory not in your path
>using chocolatey
Genuinely embarrassing. Try scoop then get back to me. I’m docking your next paycheck substantially.
people who don't know about every tool are much easier to deal with than people who autistically make a certain tool a part of their personality.
>heh, you use a carpentry hammer? Imagine that, I exclusively use ball-peen hammers. Frickin pleb
Wtf are you talking about I’m trying to help you stop shooting yourself in the foot. Alternatively stop using these dogshit install scripts written by teenagers altogether and acting surprised when something goes wrong.
lol sux2bu cmdlet when will they learn
Dilating.
how will cmdlets ever recover
use python
>still using windows in the year of our lord 1953+69
pathetic
People with jobs use powershell, so slash gee hates it.
I'm starting to believe giving candidates an interview task using powershell would be a great way to filter out poor candidates. PS seems to be great at filtering brianlettes and those that just refuse to learn
Choco is teh lame, use scoop instead.
use winget
Powerbottom Shell btfo
>what is a path
stupid c**t
Not a powershell issue.
choco install cmake.install --installargs '"ADD_CMAKE_TO_PATH=User"'
Learn to use computers
>not just using scoop at that point.
why?
did you add chocolatey's garbage dir to your PATH?
you can either modify $PROFILE or you can set the "global" Path for either user/system using powerhell.
[Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";addshithere", [EnvironmentVariableTarget]::USER)
Thanks copied those on my phone. Will check to see if they work tomorrow
That's clever but why does it all have to be in one line anyways?
See the other guy says that the kernel is the reason PowerShell is messed up when that one line inclination, or whatchamu call it, is clearly a design desicion. I don't know, my understanding is that this shell stuff is a C wrapper so they could design any way they want.
>That's clever but why does it all have to be in one line anyways?
it doesn't.... honestly doesn't even do what he wanted but whatever. his ask was gay as frick.
I usually write shit with multiple newlines and use long opts.