`$Datastores` needs to be initialized as an empty array `@()` rather than `$null`. Furthermore, if `$DsStroageOvercommit` is empty it is only initialised with a single element where there should be one element per datastore. I've moved the test into the loop instead.