Basicly I am trying to find a way to put a variable for replacing a line in powershell.
The current script:
$switches = get-outlookinbox | where subject -eq "Hello"
$e = $switches.body
$e = $e.replace("Hello:","")
$e = $e.replace(" Number","")
$e = $e.replace(":1","")
$e = $e.replace(":2","")
$e = $e.replace(":3","")
$e = $e.replace(":4","")
$e = $e.replace(":99","")
You can see what I am going for here... But I don't want 99 lines of replace code, any thoughts on this? Also, the numbers MUST have : infront of it, otherwise the replace will corrupt the file since it contains only IP's and ports, it's the ports I want to remove from the output.