PS C:\> ipconfig | # do raw prefiltering and get only lines containing this word Where-Object { $_-like'*IPv4*' } | # do RegEx filtering using a pattern for IPv4 addresses Select-String'\b(?:\d{1,3}\.){3}\d{1,3}\b' | # get the matching values Select-Object-ExpandProperty Matches | # get the value for each match Select-Object-ExpandProperty Value