July 21, 2021 at 2:16 pm
Hello, despite these discrepancies I found, I still deemed the article useful.
As an example, I might have a script that gets the latest file in a
$args[2] - third parameter passed in
if ($FileExtension.substring(1,1) -ne ".")
It should be changed to:
if ($FileExtension.substring(0,1) -ne ".")
Thank you.
July 21, 2021 at 8:45 pm
Nice catches, I'll send the author a note.
July 21, 2021 at 9:18 pm
Comments posted to this topic are about the item Powershell Day by Day: Customizing Scripts with Parameters
July 21, 2021 at 9:45 pm
Using named parameters is also a good time to strongly type cast them, that let's someone know real quick if they've entered a value that's not expected.
July 22, 2021 at 12:54 pm
We really didn't need yet another programming 101 article cluttering up the internet. Search on "PowerShell script with parameters" and the first hit is a nearly identical article from 2019 and another on the first page from 2011, and more if you keep looking. The general programming concept has been around for 40 or 50 years. In my late 80's high school programming class I was taught to use parameters, to keep code and data separate. Please help keep the Internet from getting even more cluttered, harder to find what you want. #STPL, "search first, post later".
July 22, 2021 at 6:41 pm
I'll completely disagree. Not to get into a debate here, but different people write in different voices, and the way that this author, or some other, might present a topic is valuable I in no way think that a topic should have one author or one article for all to read. This isn't a fact, but a teaching opportunity to help others, and there is no reason to only have one teacher for others to see.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply