我正在尝试自动获取 WiFi 名称和密码。我最大的问题是以 system.array 格式解析输出。因为我不能简单地通过它的键访问值。我正在寻找一种方法来确保如果在不同的 PC 上运行解析不会停止。
> $all_profiles = netsh wlan show profile
> $all_profiles
Profiles on interface Wi-Fi:
Group policy profiles (read only)
---------------------------------
<None>
User profiles
-------------
All User Profile : GRUBISIC
All User Profile : HUAWEI
All User Profile : A1
All User Profile : Ma
All User Profile : Ka
All User Profile : Ou
All User Profile : GK_Si
All User Profile : 93
All User Profile : 9B
All User Profile : Li
All User Profile : A
All User Profile : NETI
All User Profile : Re
All User Profile : Chu
> $all_profiles.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Object[] System.Array
现在我想将它解析到配置文件名称列表中,所以:[GRUBISIC, HUAWEI ...]