They did PR campaigns against Linux and OpenOffice for quite some time – until cloud computing took off and it turned out they could earn more money by supporting Linux than by fighting it.
In fact, Microsoft weren’t happy about FOSS in general. I can still remember when they tried to make “shared source” a thing: They made their own ersatz OSI with its own set of licenses, some of which didn’t grant proper reuse rights – like only allowing you to use the source code to write Windows applications.
Aw, c’mon! Who doesn’t enjoy piping ten megabytes of JavaScript through Webpack to achieve those crucial on-scroll effects on an otherwise static page?