Tag: csv

Network Scanner v1.0

This PowerShell script is a network scanner. Utilising the Invoke-PingSweep function, it will attempt to ping each host in the specified range and if it gets a response, it will attempt to find open ports from a specified list.

The Invoke-PingSweep function is available from the TechNet gallery and I take no credit for writing this integral part of the script. https://gallery.technet.microsoft.com/scriptcenter/Invoke-TSPingSweep-b71f1b9b

This script will then output a list of discovered IP addresses, hostnames and open ports. There are options to then export to a CSV and/or TXT file as well.

Usage: .\NetScan.ps1 -StartIP -EndIP [-CSV file.csv] [-TXT file.txt] [-CSVHostsOnly] [-TXTHostsOnly]

View / Download Script

Find/Replace Script v1.0

This PowerShell script is a simple find/replace tool, much like the ones you find inside your favourite text editors. Unlike most text editors, however, this will run against all files of a certain extension within a specified folder. This enables you to edit, say for example, every CSV file in folder C:\LotsofCSVfiles.

I wrote this script as I had a large number of CSV files that I needed the same find/replace function performed on all files. Rather than opening 100+ CSV files and running a find/replace one-by-one, I could simply tell this script to search for all files in the folder and do the find/replace.

By default, the script looks for CSV files, but using the -Ext parameter, you can select a different file extension. As the standard functions work via regular expressions, I have also added a line to escape any characters to prevent failures.

Usage: .\FindReplace.ps1 -Path C:\folder\path -String "findme" -Replace "replaceme" [-Ext txt]

View / Download Script

CSV Tool: Remove Last Line v1.1

This PowerShell script is part of a group of CSV Tools I have written. The script is a simple one that simply removes the last line of an inputted CSV file. It can obtain the CSV file either by being directly passed the name of a CSV file, by being given a text file list or finally by searching a directory for all CSV files.» Continue reading...