jcwalker / wifiprofilemanagement Goto Github PK
View Code? Open in Web Editor NEWModule used for management of wireless profiles
License: MIT License
Module used for management of wireless profiles
License: MIT License
Get-WiFiProfile and Get-WifiAvailableNetwork return a ProfileName. I'd like to understand how this corresponds to other similar names. I have attached a screenshot to illustrate my questions.
Originally I thought the WiFi ProfileName corresponded to the Windows network name in Get-NetConnectionProfile and the control panel, but I see that is not always the case, as with "leppard 2" in the screenshot.
Using command:
Remove-WiFiProfile -ProfileName <SSID>
Return code: -37104
Remove-WiFiProfile : Exception calling "ShouldProcess" with "1" argument(s): "Windows PowerShell is in NonInteractive
mode. Read and Prompt functionality is not available."
At C:\WINDOWS\AdminArsenal\PDQInventoryRemoteCommand\service-1\exec\command.ps1:3 char:1
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Remove-WiFiProfile
I'm experiencing a similar issue that was described in #31 but I'm not having any WMI issues. Is this a bug? I appreciate any help!
PS C:\> New-WiFiProfile -ProfileName $ssid -ConnectionMode auto -Authentication WPA2PSK -Encryption AES -Password $ssid_psk
New-WiFiProfile : Wi-Fi interface not found on the system.
At line:1 char:1
+ New-WiFiProfile -ProfileName $ssid -ConnectionMode auto -Authenticati ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-WiFiProfile
$PSVersionTable
Name Value
---- -----
PSVersion 5.1.19041.2364
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.2364
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Get-NetAdapter
Name InterfaceDescription ifIndex Status MacAddress LinkSpeed
---- -------------------- ------- ------ ---------- ---------
Local Area Connection 2 Viscosity Virtual Adapter V9.1 16 Not Present 00-FF-BE-8A-AB-32 0 bps
Wireless Network Conne... Intel(R) Dual Band Wireless-AC 3165 15 Up E0-94-67-A7-F6-20 72.2 Mbps
Local Area Connection Intel(R) Ethernet Connection I219-V 11 Disconnected 50-7B-9D-95-00-A7 0 bps
Local Area Connection 3 Viscosity Virtual Adapter V9.1 #2 8 Not Present 00-FF-69-65-94-58 0 bps
Bluetooth Network Conn... Bluetooth Device (Personal Area Netw... 6 Disconnected E0-94-67-A7-F6-24 3 Mbps
Get-NetAdapter -Name 'Wireless Network Connection' | fl
Name : Wireless Network Connection
InterfaceDescription : Intel(R) Dual Band Wireless-AC 3165
InterfaceIndex : 15
MacAddress : E0-94-67-A7-F6-20
MediaType : Native 802.11
PhysicalMediaType : Native 802.11
InterfaceOperationalStatus : Up
AdminStatus : Up
LinkSpeed(Mbps) : 72.2
MediaConnectionState : Connected
ConnectorPresent : True
DriverInformation : Driver Date 2022-02-20 Version 19.51.40.1 NDIS 6.60
$WiFiAdapterName = 'Wi-Fi' in private function Get-WiFiInterfaceGuid doesn't work for non English Windows locales, because the name of WiFi adapter is another.
Would it be possible make a command0 that showed which wifi-network you were connected to? Something like Get-WifiConnectedProfile or Get-WifiConnection?
Looking to retrieve a value based on whether a WifiProfile was successfully removed or their was an error. For instance if the Profile did not exist I want to have it return an error. I'm not seeing any way in the documentation to access this information currently.
Example would be:
try { Remove-WifiProfile -ProfileName $WifiProfile } catch { Write-Host ("Profile does not exist. Please enter Wifi Profile again.") $WifiProfile = Read-Host ("Wifi Profile") }
Add the WlanScan function to scan (search) for WiFi networks
Why is https://github.com/jcwalker/WiFiProfileManagement/blob/dev/Public/Set-WiFiProfile.ps1#L18 limited to "PEAP"(aka MSCHAPv2) or "TLS".
? I'm curious if this is a Powershell limitation or just a feature not yet considered for this project.
I've got a few machines that have default WiFi adapters not called 'Wi-Fi' which can't be renamed (no idea why).
I can put together a PR to change this modules behavior so that anytime it currently relies on defaulting to WiFiAdapterName='WiFi' it instead enumerates and uses all WiFi adapters. This would mean the exported functions would "just work" with non standard adapter names and multiple adapters without having to remember to pass the WiFiAdapterName parameter.
The https://msdn.microsoft.com/en-us/library/windows/desktop/ms706716(v=vs.85).aspx API should provide what I need.
If I put a PR together to do this would it be accepted (in principal)?
Thanks
PS C:\Users\username> Install-Module -Name wifiprofilemanagement Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): y
PS C:\Users\username> Get-WiFiAvailableNetwork
Get-WiFiInterfaceGuid : Wi-Fi interface not found on the system.
At C:\Program Files\WindowsPowerShell\Modules\wifiprofilemanagement\0.5.0.0\WiFiProfileManagement.psm1:112 char:22
+ ... rfaceGUID = Get-WiFiInterfaceGuid -WiFiAdapterName $WiFiAdapterName - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-WiFiInterfaceGuid
my network adapter was renamed from the default to wlan0.
Thank you for making all these P.S. available, but I realized when creating new profiles, setting new profiles I do not see possible to add the user and the user password that will connect to the wi-fi.
I just wanted to send you a note. You can close this issue.
I updated to PowerShell 5.0. But Get-NetAdapter only appears on Windows 8 and later.
PS C:\Users\michaelmie> get-wifiprofile
Get-NetAdapter : The term 'Get-NetAdapter' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At C:\Users\michaelmie\Documents\WindowsPowerShell\Modules\WiFiProfileManagement\WiFiProfileManagement.psm1:195 char:40
/+ [System.Guid]$interfaceGUID = (Get-NetAdapter -Name $WiFiAdap ...
/+ ~~~~~~~~~~~~~~
/+ CategoryInfo : ObjectNotFound: (Get-NetAdapter:String) [], CommandNotFoundException
/+ FullyQualifiedErrorId : CommandNotFoundException
Error opening WiFi handle.
At C:\Users\michaelmie\Documents\WindowsPowerShell\Modules\WiFiProfileManagement\WiFiProfileManagement.psm1:26 char:9
/+ throw $($Script:localizedData.ErrorOpeningHandle)
/+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/+ CategoryInfo : OperationStopped: (Error opening WiFi handle.:String) [], RuntimeException
/+ FullyQualifiedErrorId : Error opening WiFi handle.
Mike
Is there any way of specifying the authentication mode as 'User or computer authentication'?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.