/ _ \ \_\(_)/_/ _//"\\_ more on JOHLEM.net / \ 0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0 Network Commands: --------------------------- 1. **Test-Connection** (Alias: `ping`) Test network connectivity to a remote host. Syntax: Test-Connection -ComputerName "RemoteHost" -Count 4 Example: Test-Connection -ComputerName google.com -Count 4 2. **Get-NetIPAddress** Display the IP addresses on the local system. Syntax: Get-NetIPAddress 3. **New-NetIPAddress** Assign a new IP address to a network interface. Syntax: New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress "192.168.1.100" -PrefixLength 24 -DefaultGateway "192.168.1.1" 4. **Get-NetAdapter** Retrieve information about network adapters. Syntax: Get-NetAdapter 5. **Enable-NetAdapter** Enable a network adapter. Syntax: Enable-NetAdapter -Name "Ethernet" 6. **Disable-NetAdapter** Disable a network adapter. Syntax: Disable-NetAdapter -Name "Ethernet" 7. **Get-NetRoute** Display the current routing table. Syntax: Get-NetRoute 8. **New-NetRoute** Add a new route to the routing table. Syntax: New-NetRoute -DestinationPrefix "10.0.0.0/24" -InterfaceAlias "Ethernet" -NextHop "192.168.1.1" 9. **Get-NetFirewallRule** List all firewall rules. Syntax: Get-NetFirewallRule 10. **New-NetFirewallRule** Create a new firewall rule. Syntax: New-NetFirewallRule -DisplayName "Allow ICMPv4-In" -Direction Inbound -Protocol ICMPv4 -Action Allow 11. **Remove-NetFirewallRule** Remove an existing firewall rule. Syntax: Remove-NetFirewallRule -DisplayName "Allow ICMPv4-In" 12. **Test-NetConnection** (Alias: `tnc`) Test network connection and diagnostic information. Syntax: Test-NetConnection -ComputerName "RemoteHost" -Port 80 Example: Test-NetConnection -ComputerName google.com -Port 443 13. **Get-NetAdapterStatistics** Display network adapter statistics. Syntax: Get-NetAdapterStatistics -Name "Ethernet" 14. **Resolve-DnsName** (Alias: `nslookup`) Resolve a DNS name to an IP address. Syntax: Resolve-DnsName -Name "example.com" 15. **Get-DnsClientCache** Display the DNS client cache. Syntax: Get-DnsClientCache 16. **Clear-DnsClientCache** Clear the DNS client cache. Syntax: Clear-DnsClientCache 17. **Get-NetTCPConnection** Display active TCP connections. Syntax: Get-NetTCPConnection 18. **New-NetFirewallRule** with Port Create a firewall rule to allow traffic on a specific port. Syntax: New-NetFirewallRule -DisplayName "Allow Port 8080" -Direction Inbound -Protocol TCP -LocalPort 8080 -Action Allow +----------------------------------------------------------+ | Note: Network commands allow for monitoring, configuring,| | and troubleshooting network connections and | | settings directly from PowerShell. | +----------------------------------------------------------+