Context : I'm coding a lot of CLI commands and I noticed most of the time if I don't set what store I'm operating on, it will counter-intuitively be set to the first non-global store. Since more often than not I need to operate on the global store (aka \Magento\Store\Model\Store::DEFAULT_STORE_ID) I have begun setting the current store at the beginning of my scripts.
As far as I know there are two different ways to set the current store in Magento 2 : One is using the \Magento\Store\Model\StoreManager and the other one is using \Magento\Store\Model\App\Emulation.
Question : Which method is considered best practice for environment initialisation?
Thank you guys. :)