Some 20y ago I used "scratchpad" or whatever it was called to write short "bash" scripts and run them directly from that "notepad"... and it was a blast.

I never understood why it has to be so hard on Windows to enable users to do just a little bit of scripting like it's not 80's anymore.

LINQPad [1] is a terrific utility for this workflow with dotnet. I was part of a team where we built all kinds of runbooks, support utilities, and debugging tools with LINQPad using a common set of utility functions to dump (pretty-print) system-specific entities and even charts.

[1]: https://www.linqpad.net/

I thought it was Windows only, but looks like there's a macOS version now!