7 lines
317 B
PowerShell
7 lines
317 B
PowerShell
# Get network connections
|
|
$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
|
|
$connections = $networkListManager.GetNetworkConnections()
|
|
|
|
# Set network location to Private for all networks
|
|
$connections | % {$_.GetNetwork().SetCategory(1)}
|