Skip to content

Instantly share code, notes, and snippets.

@kevinblumenfeld
Last active June 19, 2017 01:52
Show Gist options
  • Save kevinblumenfeld/3ffcce4c32c9a3fc598f4abd959798bb to your computer and use it in GitHub Desktop.
Save kevinblumenfeld/3ffcce4c32c9a3fc598f4abd959798bb to your computer and use it in GitHub Desktop.
$searches = Get-ComplianceSearch | select name, @{n = "SharePoint"; e = {(Get-ComplianceSearch $_.identity).SharePointLocation}}
foreach ($row in $searches) {
$searchHash = @{}
if ($($row.SharePoint)) {
foreach ($site in $row.SharePoint) {
$searchHash['name'] = $row.name
$searchHash['SharePoint'] = $site
$resultArray += [psCustomObject]$searchHash
}
}
else {
$searchHash['name'] = $row.name
$searchHash['SharePoint'] = "none"
$resultArray += [psCustomObject]$searchHash
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment