when relevant content is
added and updated.
I saw a question on how to get wireless networks which got me thinking about string handling and working with legacy command line utilities. I also wanted to compare the options available in Windows PowerShell and PowerShell Core.
First up is a relatively brute force approach. This approach works is relatively easy to understand and maintain but isn’t very elegant.
Start by using netsh to get the wireless networks. Skip the first 4 lines (run the netsh command by itself to see what’s being skipped) and filter out blank lines (empty strings). For each line check if it’s of interest and if so split on the : character and take the data into a variable. On the radio type line create an object and output.