Good evening I hate Windows. Yes, I have to do this.
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.
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 a few minutes. To do this, the only way is to run a batch file that executes the .ps1 script. Du verstehst?
That doesn't make any sense. Why not just use PowerShell directly then? Why use Bash or even command line and a batch file? It sounds to me like you're over-complicating things for nothing and putting the blame on Microsoft for some reason.
I'm a heavy Bash user myself and often find myself struggling a bit with PowerShell trying to look for equivalent commands. (commandlets?) But, the more I use it, the more I understand how it works and the more I improve my skills at using it.
I know a lot of people like to shit on Microsoft, but seriously give their PowerShell a chance. It has its strengths. It's especially nice with Oh My Posh running in Windows Terminal.
I have to run the .ps1 script in a new Command Prompt because the compilation takes a few minutes
I don't follow this reasoning. Is it because you don't want to take over the VSCode terminal with a long command? Couldn't you can open multiple tabs, or run in the background, or use screen/tmux, etc.?
You can open as many as you want, and as many types as you want. Bash, PowerShell, Command Prompt... there's zero need to chain multiple just to keep your main one free.
Don't forget to run some docker container on that VM, to encapsulate the workload, so it will be: SSH to VM -> open a shell into the container -> run the rest
My work someone made a robust automated build script, and they left so someone else made a wrapper around it to make it easier to work with, they're gone now and someone wrote a wrapper around that to extend functionality in a backwards compatible way, but it's overly complicated for my minimal use cases so I wrote a batch file to call it with my default settings...
After learning PowerShell and then moving to Linux and having to learn bash...I don't get this sentiment. PS is the shit. I can make full GUI applications and automate all kinds of workflows. Their use of objects makes it so easy to extract data and utilize it. Bash feels so much more primitive and clumsy by comparison. What am I missing here?
Bash sucks. At best, only use it to pipe commands into each other in the terminal (Or change your shell to something else). For scripting, use Python or something.
People use Bash for quick and dirty scripts, because it's pretty much just a few symbols in between all the commands that they know and use all the time anyways. You don't really 'learn' Bash in a dedicated manner, you rather just pick up on tricks and tidbits over years.
For more than that, you'd use Python, Ruby or a full-fledged programming language.
Personally, I would even go so far that Powershell hardly added something new that wasn't already covered by a programming language...
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. ;)
Until you have it write a github action that uses a bash script to process a directory structure with spaces in the names. Never seen ChatGPT so confused before.
This is a common issue in software, not limited to scripting. Software are getting more and more layers of wrappers/adapter code, like a Russian doll. It contributes to dependency hell, as each layer brings new dependencies.
Developers often find it easier to wrap existing apps and software, and add another layer on top, rather than improving or replacing what exists.