I am posting a success instead of a failure, for a change ;-). In brief, I've patched the test file for Win32::Netsh so that the Wlan instance tests no longer fail (on a recent Windows release). I first wrote a short subroutine which I'll submit here for comments and critiques:

#!/usr/bin/env perl use strict; use v5.18; use utf8; use warnings; use Carp qw/carp croak/; =head1 DESCRIPTION Find the major Windows version from the commandline "ver" command. =cut # ------------------------------------------------------- # # Example Windows 11 version string (bought the machine # with Windows 10 loaded on it): # Microsoft Windows [Version 10.0.26100.4349] # ------------------------------------------------------- # sub findVer { my ( $which , $verstr ); $verstr = `ver`; chomp $verstr; $verstr =~s{\A\n}{}; $verstr =~m'\[Version\s (\d+) [.]'x; carp( qq/Couldn't get version from string "$verstr"/ ) unless $1; $which = $1; return $which; } say findVer(); __END__

The reason it matters to Win32::Netsh is that at some vague point in time (Google AI doesn't know exactly when), M$ stopped calling a wireless interface a "Wireless Network Connection" and started calling it a "Wi-Fi". This broke the Win32::Netsh test suite file 02-Win32-Netsh-Wlan.t for my machine. Here's the patch (Unified diff format, line endings converted to UNIX). I'd be very interested in hearing from other Windows Perlers how this patch works on their version of Windows (I'm going to test it on Windows7):

--- a/t/02-Win32-Netsh-Wlan.t 2015-11-17 16:07:55.000000000 -0500 +++ b/t/02-Win32-Netsh-Wlan.t 2025-06-18 14:52:56.388437700 -0400 @@ -26,36 +26,61 @@ ); } use_ok(qq{Win32::Netsh::Wlan}, (qw(:all))); } +##--------------------------------------- +## Find Windows Version + +# ------------------------------------------------------- # +# Example Windows 11? or 10? version string: +# Microsoft Windows [Version 10.0.26100.4349] +# ------------------------------------------------------- # +sub findVer +{ + my ( $which , $verstr ); + $verstr = `ver`; + chomp $verstr; + $verstr =~s{\A\n}{}; + $verstr =~m'\[Version\s (\d+) [.]'x; + carp( qq/Couldn't get Windows version from string "$verstr"/ ) un +less $1; + $which = $1; + # say "VERSION: " . $which; + return $which; +} + +my $generation = findVer(); ##--------------------------------------- ## List of profiles to use for testing ##--------------------------------------- my @test_profiles = ( { filename => qq{win32-netsh-wlan-single.xml}, info => { name => qq{Win32-Netsh-Wlan-Single}, auth => qq{Open}, cipher => qq{None}, - interface => qq{Wireless Network Connection}, + interface => ( $generation >= 10 ? + qq{Wi-Fi} + : qq{Wireless Network Connection} ), mode => qq{automatical}, net_type => qq{Infrastructure}, radio => qq{[ Any Radio Type ]}, ssid => [qq{SSID-Single}], }, }, { filename => qq{win32-netsh-wlan-dual.xml}, info => { name => qq{Win32-Netsh-Wlan-Dual}, auth => qq{Open}, cipher => qq{None}, - interface => qq{Wireless Network Connection}, + interface => ( $generation >= 10 ? + qq{Wi-Fi} + : qq{Wireless Network Connection} ), mode => qq{automatical}, net_type => qq{Infrastructure}, radio => qq{[ Any Radio Type ]}, ssid => [ qq{SSID-Dual-01}, qq{SSID-Dual-02}
Jun 18, 2025 at 20:50 UTC

In reply to Win32::Netsh tests repaired (-: by Intrepid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.