It’s about time to give a few examples of our scripts, and I thought I’d start out with a few basics from the search-linerui script.
I have tried to create an accurate help description with in the script, so everything should be explained with the use of “get-help .\search-lineuri.ps1 -Detailed” but here are a few pointers with screenshots as well.
One of the errors I see when other use the script is when the run it without any parameters. When the script was first created it did not require any parameters, but in order to do all the things I want to with it I had to make parameters mandatory. If you run the script without any valid parameters, you should receive the following custom error prompt:
Try run the script with at least one parameter like “-search” to get a result:
Please observe I have set a validation on the number parameter ($URIsearch) at least 2 digits and maximum 20 digits long ([ValidateLength(2,20)]). It will cause a system error if a search is tried with fewer or longer extensions:
That’s all for now. I will post more screen shots and usage examples in the following weeks