build 7bbbddf7 | content blog-content@c8490fa · 338 posts | profiles 20 · corpus 267 | 0 skipped | | format
apiVersion: soultec.ch/v1kind: Postmetadata: name: powershell-script-to-test-multiple-ip-addresses locale: en labels: author: dario-doerflinger series: scripting capability/automation: 1.78 vendor/vmware: 0.88 annotations: source: blog-content/posts/en/powershell-script-to-test-multiple-ip-addresses.md route: /en/insights/powershell-script-to-test-multiple-ip-addresses/ schema: /nerd/schema/posts.json markdown: /en/insights/powershell-script-to-test-multiple-ip-addresses.mdspec: title: PowerShell Script to test multiple IP Addresses date: 2024-02-04 author: dario-doerflinger locale: en summary: >- This small scriptlet reads a CSV with a column called “IPaddress” and pings its way through the addresses. In a lot of projects I have to confirm that a set of IPs is free. capabilities: [automation] vendors: [vmware] series: scripting hero: /blog-assets/powershell-script-to-test-multiple-ip-addresses/hero.webp migrated: 2026-08-24 translationReviewed: false draft: false sections: - body: | This small scriptlet reads a CSV with a column called "IPaddress" and pings its way through the addresses. In a lot of projects I have to confirm that a set of IPs is actually free. This scriptlet colour-codes the result and can be re-run whenever you need it, at almost no effort. ```powershell Param( [Parameter(Mandatory=$true, position=0)][string]$csvfile ) $ColumnHeader = "IPaddress" Write-Host "Reading file" $csvfile $ipaddresses = import-csv $csvfile | select-object $ColumnHeader Write-Host "Started Pinging.." foreach ($ip in $ipaddresses) { if (test-connection $ip.("IPAddress") -count 1 -quiet) { write-host $ip.("IPAddress") "Ping succeeded." -foreground green } else { write-host $ip.("IPAddress") "Ping failed." -foreground red } } Write-Host "Pinging Completed." ```status: corpus: 267 alsoLike: - {ref: posts/vmware-explore-las-vegas-hackathon-2025, score: 1.00} - {ref: posts/vmware-hackathon-2024-project, score: 1.00} - {ref: solutions/vmware/vmware-cloud-foundation/addon/application-services, score: 0.60}
{ "apiVersion": "soultec.ch/v1", "kind": "Post", "metadata": { "name": "powershell-script-to-test-multiple-ip-addresses", "locale": "en", "labels": { "author": "dario-doerflinger", "series": "scripting", "capability/automation": "1.78", "vendor/vmware": "0.88" }, "annotations": { "source": "blog-content/posts/en/powershell-script-to-test-multiple-ip-addresses.md", "route": "/en/insights/powershell-script-to-test-multiple-ip-addresses/", "schema": "/nerd/schema/posts.json", "markdown": "/en/insights/powershell-script-to-test-multiple-ip-addresses.md" } }, "spec": { "title": "PowerShell Script to test multiple IP Addresses", "date": "2024-02-04", "author": "dario-doerflinger", "locale": "en", "summary": "This small scriptlet reads a CSV with a column called “IPaddress” and pings its way through the addresses. In a lot of projects I have to confirm that a set of IPs is free.", "capabilities": [ "automation" ], "vendors": [ "vmware" ], "series": "scripting", "hero": "/blog-assets/powershell-script-to-test-multiple-ip-addresses/hero.webp", "migrated": "2026-08-24", "translationReviewed": false, "draft": false }, "sections": [ { "body": "This small scriptlet reads a CSV with a column called \"IPaddress\" and pings its way through the addresses.\n\nIn a lot of projects I have to confirm that a set of IPs is actually free. This scriptlet colour-codes the result and can be re-run whenever you need it, at almost no effort.\n\n```powershell\nParam(\n[Parameter(Mandatory=$true, position=0)][string]$csvfile\n)\n$ColumnHeader = \"IPaddress\"\nWrite-Host \"Reading file\" $csvfile\n$ipaddresses = import-csv $csvfile | select-object $ColumnHeader\nWrite-Host \"Started Pinging..\"\nforeach ($ip in $ipaddresses) {\n if (test-connection $ip.(\"IPAddress\") -count 1 -quiet) {\n write-host $ip.(\"IPAddress\") \"Ping succeeded.\" -foreground green\n } else {\n write-host $ip.(\"IPAddress\") \"Ping failed.\" -foreground red\n }\n}\nWrite-Host \"Pinging Completed.\"\n```" } ], "status": { "corpus": 267, "alsoLike": [ { "ref": "posts/vmware-explore-las-vegas-hackathon-2025", "score": "1.00" }, { "ref": "posts/vmware-hackathon-2024-project", "score": "1.00" }, { "ref": "solutions/vmware/vmware-cloud-foundation/addon/application-services", "score": "0.60" } ] }}
apiVersion = "soultec.ch/v1"kind = "Post"[metadata]name = "powershell-script-to-test-multiple-ip-addresses"locale = "en"[metadata.labels]author = "dario-doerflinger"series = "scripting""capability/automation" = "1.78""vendor/vmware" = "0.88"[metadata.annotations]source = "blog-content/posts/en/powershell-script-to-test-multiple-ip-addresses.md"route = "/en/insights/powershell-script-to-test-multiple-ip-addresses/"schema = "/nerd/schema/posts.json"markdown = "/en/insights/powershell-script-to-test-multiple-ip-addresses.md"[spec]title = "PowerShell Script to test multiple IP Addresses"date = 2024-02-04author = "dario-doerflinger"locale = "en"summary = "This small scriptlet reads a CSV with a column called “IPaddress” and pings its way through the addresses. In a lot of projects I have to confirm that a set of IPs is free."capabilities = ["automation"]vendors = ["vmware"]series = "scripting"hero = "/blog-assets/powershell-script-to-test-multiple-ip-addresses/hero.webp"migrated = 2026-08-24translationReviewed = falsedraft = false[[sections]]body = '''This small scriptlet reads a CSV with a column called "IPaddress" and pings its way through the addresses.In a lot of projects I have to confirm that a set of IPs is actually free. This scriptlet colour-codes the result and can be re-run whenever you need it, at almost no effort.```powershellParam([Parameter(Mandatory=$true, position=0)][string]$csvfile)$ColumnHeader = "IPaddress"Write-Host "Reading file" $csvfile$ipaddresses = import-csv $csvfile | select-object $ColumnHeaderWrite-Host "Started Pinging.."foreach ($ip in $ipaddresses) { if (test-connection $ip.("IPAddress") -count 1 -quiet) { write-host $ip.("IPAddress") "Ping succeeded." -foreground green } else { write-host $ip.("IPAddress") "Ping failed." -foreground red }}Write-Host "Pinging Completed."```'''[status]corpus = 267[[status.alsoLike]]ref = "posts/vmware-explore-las-vegas-hackathon-2025"score = "1.00"[[status.alsoLike]]ref = "posts/vmware-hackathon-2024-project"score = "1.00"[[status.alsoLike]]ref = "solutions/vmware/vmware-cloud-foundation/addon/application-services"score = "0.60"
<?xml version="1.0" encoding="UTF-8"?><manifest kind="Post"> <apiVersion>soultec.ch/v1</apiVersion> <metadata> <name>powershell-script-to-test-multiple-ip-addresses</name> <locale>en</locale> <labels> <author>dario-doerflinger</author> <series>scripting</series> <entry key="capability/automation">1.78</entry> <entry key="vendor/vmware">0.88</entry> </labels> <annotations> <source>blog-content/posts/en/powershell-script-to-test-multiple-ip-addresses.md</source> <route>/en/insights/powershell-script-to-test-multiple-ip-addresses/</route> <schema>/nerd/schema/posts.json</schema> <markdown>/en/insights/powershell-script-to-test-multiple-ip-addresses.md</markdown> </annotations> </metadata> <spec> <title>PowerShell Script to test multiple IP Addresses</title> <date>2024-02-04</date> <author>dario-doerflinger</author> <locale>en</locale> <summary>This small scriptlet reads a CSV with a column called “IPaddress” and pings its way through the addresses. In a lot of projects I have to confirm that a set of IPs is free.</summary> <capabilities> <item>automation</item> </capabilities> <vendors> <item>vmware</item> </vendors> <series>scripting</series> <hero>/blog-assets/powershell-script-to-test-multiple-ip-addresses/hero.webp</hero> <migrated>2026-08-24</migrated> <translationReviewed>false</translationReviewed> <draft>false</draft> </spec> <sections> <section> <body>This small scriptlet reads a CSV with a column called "IPaddress" and pings its way through the addresses.In a lot of projects I have to confirm that a set of IPs is actually free. This scriptlet colour-codes the result and can be re-run whenever you need it, at almost no effort.```powershellParam([Parameter(Mandatory=$true, position=0)][string]$csvfile)$ColumnHeader = "IPaddress"Write-Host "Reading file" $csvfile$ipaddresses = import-csv $csvfile | select-object $ColumnHeaderWrite-Host "Started Pinging.."foreach ($ip in $ipaddresses) { if (test-connection $ip.("IPAddress") -count 1 -quiet) { write-host $ip.("IPAddress") "Ping succeeded." -foreground green } else { write-host $ip.("IPAddress") "Ping failed." -foreground red }}Write-Host "Pinging Completed."``` </body> </section> </sections> <status> <corpus>267</corpus> <alsoLike> <item> <ref>posts/vmware-explore-las-vegas-hackathon-2025</ref> <score>1.00</score> </item> <item> <ref>posts/vmware-hackathon-2024-project</ref> <score>1.00</score> </item> <item> <ref>solutions/vmware/vmware-cloud-foundation/addon/application-services</ref> <score>0.60</score> </item> </alsoLike> </status></manifest>
Scripting · 2024-02-04

PowerShell Script to test multiple IP Addresses

This small scriptlet reads a CSV with a column called “IPaddress” and pings its way through the addresses. In a lot of projects I have to confirm that a set of IPs is free.

2024-02-04Date
Dario DörflingerAuthor
1Min read
Topics Automation 1.78
Vendors VMware 0.88

This small scriptlet reads a CSV with a column called “IPaddress” and pings its way through the addresses.

In a lot of projects I have to confirm that a set of IPs is actually free. This scriptlet colour-codes the result and can be re-run whenever you need it, at almost no effort.

Param(
[Parameter(Mandatory=$true, position=0)][string]$csvfile
)
$ColumnHeader = "IPaddress"
Write-Host "Reading file" $csvfile
$ipaddresses = import-csv $csvfile | select-object $ColumnHeader
Write-Host "Started Pinging.."
foreach ($ip in $ipaddresses) {
    if (test-connection $ip.("IPAddress") -count 1 -quiet) {
        write-host $ip.("IPAddress") "Ping succeeded." -foreground green
    } else {
        write-host $ip.("IPAddress") "Ping failed." -foreground red
    }
}
Write-Host "Pinging Completed."

You might also like