Reputation: 95
My computer has a Windows 10 and I was following through Microsoft 98-366 Network Fundamentals book. It had me to open Windows Powershell and type
New-NetIPAddress -InterfaceAlias "Local Area Network" -IPv4Address 192.168.1.101 -PrefixLength "24" -DefaultGateway 192.168.1.1
Then I got the error that it can't find a parameter with the name IPv4Address. It'ns not a typo though, because above was directly copied from the book.
So when I looked up the documentations on New-NetIPAddress it seemed -IPv4Address is not an option and instead I have to use IPAddress. So I tried the below
New-NetIPAddress -InterfaceAlias "Local Area Network" -IPAddress 192.168.1.101 -PrefixLength "24" -DefaultGateway 192.168.1.1
Then I got a new error saying
New-NetIPAddress : Invalid parameter InterfaceAlias Local Area Network
but InterfaceAlias
does exist in the documentations, so I'm not sure what causes it to be invalid.
Thanks in advance for any kind of help.
Additionally, the documentation I looked up was this: Net-NetIPAddress
Upvotes: 1
Views: 11048
Reputation: 15470
I think the InterfaceAlias is not valid.
First look at all the network interfaces using the command Get-NetIPInterface
. Here is the output in my PC:
InterfaceAlias
--------------
vEthernet (Wi-Fi)
vEthernet (VMware Network ) 2
vEthernet (VMware Network )
vEthernet (VirtualBox Host)
vEthernet (Ethernet)
VMware Network Adapter VMnet8
VMware Network Adapter VMnet1
VirtualBox Host-Only Network
Local Area Connection* 10
Local Area Connection* 9
Ethernet
Wi-Fi
Loopback Pseudo-Interface 1
vEthernet (Wi-Fi)
vEthernet (VMware Network ) 2
vEthernet (VMware Network )
vEthernet (VirtualBox Host)
vEthernet (Ethernet)
VMware Network Adapter VMnet8
VMware Network Adapter VMnet1
VirtualBox Host-Only Network
Local Area Connection* 10
Local Area Connection* 9
Ethernet
Wi-Fi
Loopback Pseudo-Interface 1
Re-check by reading all properties with Get-NetIPInterface | Format-List *
will help you identify which is the correct network interface you are looking for.
Upvotes: 2