You have upgraded to Windows 10 and since then you have noticed that your PC automatically connects to random Wi-Fi networks? There's nothing to worry about, as it is most likely that Wi-Fi Sense is enabled on your PC. So what is Wi-Fi Sense? Basically it is a new feature integrated to Windows 10 which allows your PC to:
Connect to suggested Wi-Fi hotspots: Crowdsource open Wi-Fi networks known and used by other Windows users.
Connect to networks shared by your contacts : Connect to Wi-Fi networks that your Facebook friends, Outlook.com or Skype contacts have shared with you. This feature also allows you to share your Wi-Fi network (without revealing the password) with your contacts.
If you configured Window 10 on your PC using the Express settings, then it is most likely that Wi-Fi Sense is enabled. Wi?Fi Sense poses a privacy issue as it can track your current location even when location services are disabled on your device and furthermore, there's always a risk that your PC connects to some unsecured open networks (prone to malware infection or data theft/loss). Disabling Wi-Fi Sense is really easy:
Click on Start > Settings > Network & Internet > Wi-Fi > Manage Wi-Fi Settings:
Toggle the Connect to suggested open hotspots and/or Connect to networks shared by my contacts options off: