Hey all, can someone help this old Linux Admin to convert a command to powershell syntax? The part I need help with is the "awk" part at the end. I am just putting in the Linux command to hold the place. Basically I am getting the Name from nslookup and want to strip off "Name:" so that I am left with the FQDN. Example:
Name: mycomputer.mynet.org and then have only mycomputer.mynet.org
1) Does the nslookup
2) Pipes results to Select-String which uses RegEx to find the string containing "Name:"
3) 1 and 2 are enclosed in parenthesis so that they process before the -split operator takes affect
4) The -split operator uses RegEx to split the string into an array based off of 1 or more space characters. This results in an array with 2 elements.
5) Then we put that in parenthesis so that 1-4 process before we get the value of the element in position 1.
Bob, Curtis: Thanks. yes it makes perfect since. I failed to tell you I was doing my basic testing at the PS command line so I am getting an "Expressions are only allowed as the first element of a pipeline." I'll try it in a basic script to see if that makes a difference.