I need to Create a lot of DHCP scopes on diffrent server, i have tried to create a script that asks for the 3 first octets of the subnet, but i can´t get it to work as i want, does anyone has any idea how i can do it
I have done it this way ( the scripts ask for a lot of more info, but i have skipped the working parts)
Single and double qoutes work differently. Double qoutes are expanded and will resolve variables. Single qoutes are literal, what you type is what is used.
PS C:\Users\rasim> $test = 'foo'
PS C:\Users\rasim> 'Test value is $test'
Test value is $test
PS C:\Users\rasim> "Test value is $test"
Test value is foo
There are a couple of other small things such as the DNS servers is a string array, not a string, so the values are separated by commas. Additionally, use splatting to make it a bit easier to read: