I have the following code which works like a dream to find the relevant mac address and changes the network adapter name:
$macaddress = "%macaddress%"
$newname = "%networkname%"
$NicInterfaceName = get-wmiobject Win32_NetworkAdapter | where {$_.macaddress -eq "$macaddress"}
$NicInterfaceName.netconnectionid = "$newname"
$NicInterfaceName.put()
I want to make this code exist on one line, I know I could remove the variables, which obviously i'll do.
Help :)