Get-NetConnectionProfile only retrieves active connections.

If you truly want to change all connection profiles to Private here's some code I wrote to accomplish that task.
<#
.Synopsis
Change all network profiles to PRIVATE!
.Description
Change all network profiles to PRIVATE!
.Outputs
N/A
.Notes
Programmer : RetiredGeek (@askWoody.com) &
(@stackoverflow.com)
aka: ComputerMentor
Created : 10 Aug 2022
Last Updated : 10 Aug 2022
Current Vers : 1.0
.Example
[d:\path\]Set-AllNetworksPrivate.ps1
Will set all networks as PRIVATE in the registry.
#>
# Two blank linea above required for Comment-Based Help
#----------------- Main Program ---------------------------
Clear-Host
Add-Type -AssemblyName "System.Windows.Forms"
$StatusMsg = {
[Windows.Forms.MessageBox]::Show($Message, $Title,
[Windows.Forms.MessageBoxButtons]::OK ,
[Windows.Forms.MessageBoxIcon]::$Icon)}
#Setup Variables:
[Int32]$ErrorCnt = 0 #Note: set to 1 to test error condition!
[Version]$PGMVers = '01.00.00'
$BaseRegPath = "HKLM:\SOFTWARE\Microsoft\" +
"Windows NT\CurrentVersion\" +
"NetworkList\Profiles"
$NIPArgs = @{Name = "Category"
Value = 1
PropertyType = "DWord"
Force = $True
ErrorAction = "Stop"}
$GCIArgs = @{Path = "$BaseRegPath"
ErrorAction = "Stop"}
$Nets = Get-ChildItem @GCIArgs
ForEach ($Net in $Nets) {
Try { $Null = $Net | New-ItemProperty @NIPArgs }
Catch { $ErrorCnt++ }
}
$Title = "Set-AllNetworksPrivate Vers: $PGMVers"
$Message = "Network Status: `n`n"
If ($ErrorCnt -eq 0) {
$Message += "All profiles set to Private"
$Icon = "Information"
}
Else {
$Message += "$ErrorCnt profile(s) NOT set to Private"
$Icon = "Warning"
}
$Null = & $StatusMsg
Name the file Set-AllNetworksPrivate.ps1 to match the comment based help.