Rewrite New-CBArraySplit, minor tweaks elsewhere. #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
One major change and some minor tweaks pull request.
New-CBArraySplit does string splitting and joining to test the 4Kb limit, but file extensions can have commas in them so it risks splitting in the middle of a file extension and breaking. Reworked it to build up a temporary array on the fly, checking the extra string length each time won't push the array over the 4Kb limit. Updated it to output to the pipeline. Merged the FileGroupName property into it.
Normalise ConvertFrom-Json20 to use Param() block. Added comment.
Updated the Get-WmiObject call for drives with shares, formatting, added comments, does the share root with a DirectoryInfoCast which won't error if the item doesn't exist, and calls te Name property instead of string interpolation, forced it to be an array with @() and removed the following $null test.
Windows version comment, tweaked "other version" message.
ConvertFrom-Json20 call was using parens, which isn't PowerShell function call syntax. Changed, and expanded ForEach-Object alias in that line.
Reworked SkipList to do the trim() call when loading and use array -notcontains to remove the exclusions.
Changed the emtpy file message to use a here-string instead of backtick continuations.
Updated the call to New-CBArraySplit
Expanded % alias at end of file.