Last active
June 19, 2017 01:52
-
-
Save kevinblumenfeld/3ffcce4c32c9a3fc598f4abd959798bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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