Exploring Powershell Commandlets

Test-NetConnection


//Ping by default: internetbeacon.msedge.net
Test-NetConnection


//with a port
Test-NetConnection -Port 80 -InformationLevel Detailed

//more stuff
Test-NetConnection -ComputerName www.contoso.com 

//Ping the RDP port
Test-NetConnection ipaddress -CommanTCPPort RDP 

//Ping the HTTP port
Test-NetConnection ipaddress -CommanTCPPort HTTP

//This seem to be ok
Test-NetConnection ipaddress -TraceRoute 

//but not this
Test-NetConnection ipaddress -CommanTCPPort HTTP -TraceRoute

//TraceRoute and Port seem to be in conflict 
//as parameters

ping
tracert

ping to a specific port

Search for: ping to a specific port

SOF question: ping and ports

Understand netstat

Search for: Understand netstat

Select-Sttring: grep of powershell. kind of...


//This may not yield good results
//Pick an alias line that looks like
alias | Select-String "blah"


//Convert first to long lines
//by concatenating columns
alias | foreach {Write-Host $_.CommandType $_.Name} 

//Notice the {} vs ()
then you can pipe that to

| Select-String "someblah"