I am trying to extract the country code from a list like below which is in a text file:
lab.local/2003Servers/US/server123
lab.local/Servers/AU/server1
$file= Get-Content .\list.txt foreach ( $i in $file) { }How can I get the second index of /. Once I get the second index of / I can extract two characters after it using substring?