As a tip, a descriptive subject like “Help with subexpression in WMI query” can help make sure the right folks are looking at your post :).
You’re not using a subexpression.
Get-WmiObject -ComputerName Computer1 -Query “SELECT * FROM CIM_DataFile WHERE Drive =’E:’ and path=’\\logfiles\\W3SVC1395239964\\’ AND extension=’zip’ and Creationdate>’$((Get-Date).AddDays(-30).ToShortDateString().toString())’”
Is a subexpression. Subexpressions look like $(), not {}. {} is a script block, and WMI didn’t know what to do with it. Subexpressions get parsed by the shell before the query is sent to WMI.