Created
June 19, 2017 01:54
-
-
Save kevinblumenfeld/1fe50e89d529bf59ca3a2d7c25581e22 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