Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Need help with this code.

$
0
0
I have a list of IP Address in a CSV and need help trying to get the last octet of each IP address to use in a command for creation of DNS records.


IP ADDRESS
10.1.1.20
10.1.1.21
10.1.1.22
10.1.1.23
10.1.1.24

I used this code to find the IP for the first array.

$csv = Import-Csv -Path C:\Users\abcd\Desktop\ptr.csv
$csvip = $csv.ipaddress[0].split('.')[-1]
$csvip



How do I do this for each IP address?



99upgrade


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>