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.
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.