Getting started with PS scripting and putting together few scripts that helps in my day to day work. I am receiving the below error when I try and pass few parameters in the below script. The details are as below. What am I doing wrong ?
So, the first problem here is that you're apparently setting parameters, but never using the variables that you create.
When you are calling a function or script with arguments, you need to specify the value that you pass – so, "-Name" should be "-Name $Name" (using the parameter you created). It doesn't get automatically passed down!