I'm pretty new to PS so take it easy. The following query works to get me the IP address of a named interface.
$ActiveIP = Get-NetIPaddress -AddressFamily IPv4 | Where-Object {$_.InterfaceAlias -eq "UniqueName"} | Format-Table IPAddress
Then the $ActiveIP Variable returns the correct information im looking for. I'm am utterly stuck on how to take that and pipe it correctly to another cmd.
For instance I'd like to automate the DNS config and would pipe that variable to the following...at least that's what I think, but its a no go. I'm sure its something with how im outputting, but then again i'm a noob.
Invoke-Command -ScriptBlock {DNSCMD servername /resetlistenaddresses $ActiveIP}
Any help on straightening me out would be much appreciated.
- Edited by Slade1040 Wednesday, July 29, 2015 10:43 PM