Ok, you do not need the second command, it is accomplished by the last command.
If you already know the Alias or Index, you don't need to port ( | ) anything and you don't need to use
$netadapter at all. It still appears, and I may not be outputting the contents of $netadapter correctly, that it does not contain either the Alias or Index of the adapters. The output of the command itself does.
The need for the DNS command is still in limbo. More testing might help decide the need for it.
I have been doing some reading on the net about Powershell also. I have been trying to pay strict attention to the date of the information. I have a book I will check and see if I can find any specific information about these commands. I need to learn about Porting, so I will probably see it in one of those sections.
I can use the two command lines,
get-NetAdapter and
new-NetIPAddress, and achieve the static IP address for the adapter. But following the procedure I am still seeing the Default Gateway address disappear, in some cases, so it looks some more trials to make certain which commands will get the job done.
Edit: I suppose I should really try it in Windows 10...