Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
ddit6034yP.S. I couldn't figure out how to do if not condition in powershell and got so frustrated I literally typed this piece of shit:
if (Test-Path "video$i.ts") {
} else {
# code here
} -
Voxera113884y@ddit first hit I got on google for powershell boolean expressions
https://docs.microsoft.com/en-us/... -
WSL can be installed on server 2019 or later.
There are also MSYS and Cygwin if you need POSIX in Windows.
Regarding powershell: At least I don't have to double check if I'm using quotes when referencing variables, if those could contain whitespace.
Also I don't have to parse command output with awk.
Anyway we are comparing apples with oranges here: Bash is mostly a shell, while Powershell is a .NET scripting language and an acceptable shell. Its advantages are powerful *built-in* commands, .NET access (thus access to low-level Windows functions) and object orientation (with object oriented pipes) and certainly not similatirty to bash. And certainly it is a huge improvement over batch or vbscript (and the latter seriously has to die).
Back to bash: [ ! -f file ] isn't much better either... -
@ddit disagree on the last sentence. Microsoft doesn't need to rethink their scripting, microsoft needs to stop trying to be the white fly and adopt bash so that we can have scripts which work on every os instead of having to always say "ah wait, that machine uses windows"
-
If it's just delegating to and executing a .ts file, why not just run it with ts-node?
Powershell is absolute garbage for any number of reasons (differences on platforms, unclear error handling scenario/unhandleable errors, workflows that only exist on windows, the ability to compile and execute arbitrary code, oh god where did my ram go), but that just strikes me as personal preference/neophyte issues. -
@ddit Bruh. Are you seriously complaining about powershell's if after comparing powershell to bash? With all the bloody double square brackets and significant whitespace and cryptic one letter operators. Try and remember what it was like to figure all that out
-
Voxera113884y@M3m35terJ05h
So true :)
Also, PS has real objects so for more complex operations its superior.
Bash is in no way more intuitive, its just older and something you just have to know to use linux.
PS is much more optional for any normal user since most can be done through the gui.
And no, ms do not need to rethink PS ;)
Most will do fine without it, those who need scripting will mostly be able to install bash if they really want to, and the few thats left just have to use PS or select another OS.
If PS is such an eye sore, then why use windows.
And if you are forced to use it for dome program, ask your self, why does this not exist for linux, there might be a reason :P
So I agree with you, instead of complaining on MS, consider why you are using windows.
And don’t come dragging with their monopoly, they have never ever been that dominant in the server area, especially at the time they used bad practices.
Their servers win their position because thy where easy yo use for small companies compared to linux/unix and novell netware.
And I have worked with. All of them, even for a short while apples servers.
A unix or linux server is very scary for a desktop user. -
I mean... I don't like Bash either (though I use it a lot, sadly), but it's kind of a "lesser of two evils" case.
Bash should go and commit a die.
PowerShell should outright not have been fucking "born".
Then again, it's M$... what did you expect them to do? design something that is easy and intuitive to use? -
kamen69254yI haven't dug very deep down with Powershell, but on the surface I feel like I don't like it.
As for your script, why don't you just use something that's platform-independent, i.e. Node? -
ddit6034y@SortOfTested in this case a .ts file is not TypeScript, it is a video file format that is used for online videos. I am downloading these .ts files and I then have to stitch them together to get the full video.
-
ddit6034y@M3m35terJ05h I only started using bash about 5 months ago. I learned it when I needed to setup automatic scheduled backups. It took me a few minutes of google and testing and I got a fully functional script.
Related Rants
Powershell should die.
I have a simple bash script I made that allows me to download almost any video from the internet. Works great and took me only a few minutes to make.
The only issue is it bash meaning Windows doesn't run it natively. I am not able to install linux Subsystem or bash, etc on the server.
So I decided to rewrite it in powershell thinking it should be Okay and I have never struggled with so much retardedness in my life. After 40+ tabs in chrome and a massive headache, it finally works.
Microsoft should kill powershell entirely and rethink their scripting language.
Also VBA should have died 10 years ago.
rant
microsoft
powershell
vba