448
submitted 3 weeks ago* (last edited 3 weeks ago) by [email protected] to c/[email protected]

Since people are curious Ill explain why:

I need to build our project from the remote repo using a PowerShell script (.ps1). I’m using Bash in the VSCode terminal, I have to run the .ps1 script in a new Command Prompt because the compilation takes around 5 minutes and I need my terminal for other things. To do this, the only way is to run a batch file that executes the .ps1 script.

Its an automation so I dont need to touch powershell whatsover and remain in bash terminal. Instead of opening several windows, I automated all so it only takes 1 alias to compile my shit.

The compilation also requires several inputs and "Key Presses", so I automated all of that in the Batch file.

you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 1 points 3 weeks ago* (last edited 3 weeks ago)

Mh, it probably depends a lot where you're coming from. I don't need Powershell or have a reason to learn it in my daily work, and I mostly use WSL to access Linux shells everywhere else. And on top of that, I don't understand why Powershell needs a completely different command set to basically every other shell. It's a biased take, but I have not had an interaction with Powershell that I liked, nor have I seen a feature that made me want to look into it more.

What's the killer feature, would you say? Care giving me the fanboy-pitch?

edit. Oh and I forgot, the tab completion in Powershell is so incredibly dumb. I never ever in my life want to cycle through all items in a path, and much less have it be case insensitive. Come to think of it, this might be the origin of most of my disdain. ;)

[-] [email protected] 3 points 3 weeks ago

By far it's the object pipeline. Having structured data makes it easy to automate workflows in a predictable way. With bash everything is a string, so everything has to be parsed. It's tedious.

It took about a year of steady use before I came to enjoy the syntax. It shines in a production environment with other cooks in the kitchen. I never got into the C style, I like my code human readable at a glance. It's fine if everyone's a sage but we have a team with a mixture of skill levels and for me PowerShell gets it right.

[-] [email protected] 2 points 3 weeks ago

That actually makes a lot of sense. I never even second guessed how tedious all the parsing is. But then, as others have said here, as soon as the task at hand reaches a level of complexity beyond grepping, piping and so on I just very naturally move to Python.

On a different note, there are ways to teach bash json. I recall seeing a hacker conference talk on it some time ago, but didn't pay close attention.

this post was submitted on 07 Jun 2024
448 points (90.9% liked)

Programmer Humor

31202 readers
1923 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 4 years ago
MODERATORS