If you need Windows for temporary testing or development purposes, Microsoft provides official, time-limited evaluation ISOs of their enterprise operating systems directly on their website.
Many official Windows 7 keys can still be used to cleanly install and activate Windows 10, though Microsoft officially closed the free upgrade loophole in late 2023.