We have a target of E:\Mod01. Here is the command.
The CIM_Directory class has all that we need. The filter of 'E:\\Mod01' is not a typo. We need to escape the backslash with another backslash. This isolate the target so we do not compress other folders. This object is passed to Invoke-CimMethod where we call the Compress method.