Created
April 14, 2022 14:09
-
-
Save maravedi/ee78a308927a9f312f86ab9827c9965e to your computer and use it in GitHub Desktop.
PowerShell one-liner to show Windows network profile categories for saved wireless connections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles' | Select -Property * | %{ $Key = $_.PSChildName; $Name = $_.Name -Replace "HKEY_LOCAL_MACHINE","HKLM:"; $Category_Num = Get-ItemPropertyValue "$Name" -Name Category; If($Category_Num -eq 0){ $Category='Public' } ElseIf($Category_Num -eq 1){ $Category='Private' } ElseIf($Category_Num -eq 2){$Category = 'Domain'}; $ProfileName = Get-ItemPropertyValue "$Name" -Name ProfileName; ""|Select @{N='ProfileName';E={$ProfileName}},@{N="ProfileCategory";E={$Category} }} | Sort ProfileCategory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment