Adding logic to array in powershell
问题 I have imported a CSV file and created an array out of the data. I need to split off the domain names which used split, however some of the names are IP addresses, so it is split those as well. How can I add some logic to do my normal split? But if it's a number like a IP address, ignore and print it. Below is my sample data, the "Client Name' is what I'm trying to work with. $NewCSV = $a | ForEach-Object { $Record = @{ 'Client Name' = $_."Name".Split('.')[0] 'Policy Name' = $_.