|
Or try to do consistent quoting to pass parameters to an external executable. It's mind-blowing that a fundamental feature for a scripting language - interfacing to other commands - is so complicated. I have in some instances ended up passing parameters to batch files as environment variables. That works reliably.
And then there was the lovely incident with invisible files in an earlier version of PS. I called out to a batch file that created files on a network drive. Unfortunately, when I returned to PS the files were invisible until PS was restarted. Not a happy experience, when the PS was supposed to process backup files produced by the batch file. Caused me a good deal of lost hours - and backups!
And yes, the function return value mystery. Who ever thought that was a good idea ?
I have really tried to like PowerShell. It feels like it should be a major step up from MS-DOS scripting with proper flow control, error handling, etc. But now I try to stay away from it, as it usually ends up eating my time, especially when I need to make it talk to existing scripts.
One success story: I did a PS script that read a file and processed it via a .NET library. That was easy, clear code, and no surprises.
|
|
|
|
|
Jan Holst Jensen2 wrote: One success story: I did a PS script that read a file and processed it via a .NET library. That was easy, clear code, and no surprises.
Defeats the purpose really of having a "shell code" if you have to wrap .Net calls to get anything done...
Who the f*** is General Failure, and why is he reading my harddisk?
|
|
|
|
|
|
Totally agree and I am experiencing your pain.
I haven't been able to find a decent book or tutorial that clears away the fog.
It's like "unable to grok" was the highest design goal; followed closely by "unable to remember".
So I rely on examples colleagues have written and live in hope that one day a beam of sunlight will break through the clouds.
That and continuing to gain experience out of shear stubbornness!
Cheers,
Mike Fidler
"I intend to live forever - so far, so good." Steven Wright
"I almost had a psychic girlfriend but she left me before we met." Also Steven Wright
"I'm addicted to placebos. I could quit, but it wouldn't matter." Steven Wright yet again.
|
|
|
|
|
Every time I look at PS I feel like I'm looking at bastardized Perl.
|
|
|
|
|
|
If it was hard to create, it ought to be hard to use!
Seriously, I totally get your frustration. Stubbornness comes in handy sometimes.
Cheers,
Mike Fidler
"I intend to live forever - so far, so good." Steven Wright
"I almost had a psychic girlfriend but she left me before we met." Also Steven Wright
"I'm addicted to placebos. I could quit, but it wouldn't matter." Steven Wright yet again.
|
|
|
|
|
I have not updated this in 6 years, but it shows how to execute C# written as script.
How to Execute External Uncompiled C# Code[^]
and thus just use C# scripts to do something, instead of whatever the heck PowerShell is.
|
|
|
|
|
It's fascinating to read the comments about how so many devs feel this way about PS language.
I feel the same way. It's ugly, it's forgetable, it just feels forced. Glad I'm not alone in this.
|
|
|
|
|
Our company got onboard with .NET in ~2000.
When it came time to learn PowerShell many years ago (yes, 2.0) we had an instructor led class with a mix of developers & Windows and Linux Admins in it.
Developers (me included at the time) seemed to get PS, while the Windows and Linux struggled with it. Linux admins especially since they are heavy duty scripting folks. Problem for them was it so very different than the shells they used on Linux. Fast forward to the present, those same Linux admins are using PowerShell and are quite good at it.
Syntax always seemed a bit "clunky" to me, but the concepts were quite natural to me because of leaning .NET and C#.
|
|
|
|
|
The problem is time. I just don't have the time to learn such an obtuse syntax. Why didn't they just use C#.
Given enough time we can learn anything, but actually we are never given enough time to completely learn anything.
PS is yet another time sink.
BTW the folks who made the comments about French cars were right, the question is WHY do the French insist on swimming up stream when the large majority of uses are intuitive and the French standard is not.
Oh wait, was I discussing PS or French cars?
Hummmmmm, I think both.
|
|
|
|
|
thorne999 wrote: The problem is time. I just don't have the time to learn such an obtuse syntax. Why didn't they just use C#.
Given enough time we can learn anything, but actually we are never given enough time to completely learn anything.
PS is yet another time sink.
All of my this.
ETA: It reminds me of SQL/DML/SML??? whatever the last one was called. They syntax is ridiculous and I find I have to go back to the reference way too much.
Real programmers use butterflies
|
|
|
|
|
Has it just not been posted yet? Understandable, just curious.
Real programmers use butterflies
|
|
|
|
|
It takes the hamsters a couple of days to get the list together - it'll be up early next week, it usually is.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Look at me being all impatient. Heh. I like the contests, what can I say? It's as close to off track betting as I get.
Real programmers use butterflies
|
|
|
|
|
is looking for couples married 7 years or more, to educate people on social distancing!
I'm not sure how many cookies it makes to be happy, but so far it's not 27.
JaxCoder.com
|
|
|
|
|
Not just the US of A having it's annual "Get drunk and blow stuff up" day, but for England as well.
Yes, tonight pubs will open for the first time since March - observing social distancing of course, something drunk people known to be good at - with the Prime Minister urging everyone to drink "safely and responsibly".
Riiiiiight. That should work well ...
Expect "Lockdown V2.0 - this time we're serious" in a couple of weeks.
So, anyone in England heading pub-wards tonight?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Saturday night in Woking is bad enough at the best of times. I could walk to the pub/restaurant at the top of the road but no doubt that will be full as well.
|
|
|
|
|
at The Sovereigns
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
|
Wow, that looks nice. I would go there.
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
The restaurant is not cheap but food generally is excellent. The pub side is nice too.
|
|
|
|
|
Good grief.
I worked in Byfleet for most of the 90's and some the 00's ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I've lived in the area (Molesey, Walton, West Byfleet and now Woking) since 1995. Strange how we never met.
|
|
|
|
|
Condolences. Once the alcohol ban was lifted in South Africa there was a marked increase in traffic incidents, etc.
|
|
|
|