When a large number of shares are defined it may cause the generated command to exceed the maximum allowed length. To prevent this, only allow 10 shares to be processed at a time. Fixes #10483