Private/Test-FatCsvHeaders.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Function Test-FatCsvHeaders {
    param(
        [parameter(Mandatory = $true)] [string]$csvPath

    )
    $headers = (get-content $csvPath)[0] -split ','
    if ($headers.Length -ne 7) {
        Throw
    }
    if ( (Compare-Object $headers "Container,Folder,ADGroup,ADGroupID,DefaultPermission,AccessPermission,Recurse".Split(",")) ) {
        Write-Host 'Headers are different!'
        Throw
    }
}