News for hackers. Stuff that matters.
Re:Microsoft Dependency Has Risks by majkinetor on Thursday June 26, 2025 @12:55AM (#44384289)
All that, and finally, PowerShell, literary light years ahead of everything Linux has to offer. I have PTSD from bash and friends. It is so good, that I rarely even write C# nowadays for most of the critical government stuff and simply run smallish scripts as services, and change them on the server when intervention is needed in notepad, in a couple of minutes, while my colleagues still worm up their full-blown Visual Studio.

I love it like it is the hottest wife that have a great job, do the dishes and cooks like a grandma (I am bad at this :))

Re:Microsoft Dependency Has Risks by bluefirebrand on Thursday June 26, 2025 @02:11AM (#44384638)
> change them on the server when intervention is needed in notepad

How is this any different than a Linux setup where you can just ssh into a box and edit your scripts in the shell using something like nano or vim if you're into that sort of thing?

Re:Microsoft Dependency Has Risks by majkinetor on Thursday June 26, 2025 @05:16AM (#44385607)
It's not different. I am not talking about method, I talk about the language and ecosystem. Package manager for scripts? Yeah. Standardized names and params? Fuck yeah. Drop to dotNet on funky corners? Shut up and take my money.

Put pwsh on linux (I do, in all of them) and I will use ssh and vim no problem.

Re:Microsoft Dependency Has Risks by mrcsharp on Thursday June 26, 2025 @04:40AM (#44385441)
And now there is going to be support for `dotnet run app.cs` which, in my opinion, will replace most of my powershell scripts.
Re:Microsoft Dependency Has Risks by majkinetor on Thursday June 26, 2025 @05:14AM (#44385601)
Yeah, that is a new thing, but honestly it existed a way back, its just that it is now officially supported.

But you are missing a point here. It's about the language, ecosystem and practicality. In shell, you need correct abstraction that lets you work in fast and efficient way and lets you interact fast when debug is needed. What is done using c# in 10 lines can be done in a single line in pwsh. In my book, lower amount of code, ideally no code, is the most important aspect of the development. Majority of things are not constrained by the performance, so pwsh is usually a good fit.

People used ruby, python etc. for infrastructure development long time ago and it was/is akward.

Re:Microsoft Dependency Has Risks by mrcsharp on Thursday June 26, 2025 @08:50AM (#44386931)
> What is done using c# in 10 lines can be done in a single line in pwsh

Mostly, yes. The problem is that the moment I need something more than what a single cmdlet or bash utility can provide, now I have to use an awkward looking scripting language (bash is the worst offender here). Almost every time I found myself having to write a somewhat long script file, I wish I could just do it with a C like language instead.

For simpler tasks, I fully agree. It is better to use something immediately available like an OS shell utility over coding one myself.

Re:Microsoft Dependency Has Risks by majkinetor on Thursday June 26, 2025 @11:45AM (#44388523)
There are many simple tasks in a typical multiyear project. Most of my scripts are between 100 and 1000 lines of code.

Example: https://github.com/majkinetor/SSImport

That script made noticeable difference in speed, quality and pleasure on our recent project (production tests on payment gateway for half of the country) as before I wrote it, devs did it by hand which took 10s of minutes every day with awkward tools (if they made an error, even more) and they complained about the chore. The script literarry replaces entire feature of the Sql Server Management Studio and I did it during the weekend.

Regarding syntax, not sure why would you consider that awkward. IMO, it can't be easier to read in any language, both configuration and code.

Re:Microsoft Dependency Has Risks by whoknowsidont on Thursday June 26, 2025 @04:42PM (#44391135)
Your github link 404's, FYI.
Re:Microsoft Dependency Has Risks by majkinetor on Thursday June 26, 2025 @05:38PM (#44391728)
Sorry, was private repo, now its public.
Re:Microsoft Dependency Has Risks by mrcsharp on Thursday June 26, 2025 @07:25PM (#44392440)
I think we are talking a bit past each other here. I don't contest the benefit of writing small helper utilities.

> Regarding syntax, not sure why would you consider that awkward

This is more true with Bash than Powershell. However, this is the same with programming languages in general. There are those who look at Julia's syntax and think it's absolutely beautiful and those who consider it to be absolutely bad and prefer Visual Basic.