Last active
February 28, 2017 15:49
-
-
Save joeypiccola/9d0701b2b4637dd8ec9123e46434df38 to your computer and use it in GitHub Desktop.
This file contains 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
function Get-ClusterDatastoreClusters | |
{ | |
param | |
( | |
[CmdletBinding()] | |
[Parameter(Mandatory)] | |
[string]$Cluster | |
) | |
begin | |
{ | |
# verify we can connect to the provided cluster. | |
if (!($GetCluster = Get-Cluster -Name $Cluster)) | |
{ | |
Write-Verbose "Unable to connect to `"$Cluster`"" | |
break | |
} | |
} | |
process | |
{ | |
$pods = Get-Cluster $Cluster | Get-Datastore | ?{$_.ParentFolderId -like 'StoragePod-group-*'} | sort -Unique -Property ParentFolderID | |
Write-Verbose "Found $($pods.count)x datastore cluster on $cluster cluster." | |
foreach ($pod in $pods) | |
{ | |
$GetPod = Get-DatastoreCluster -Id $pod.ParentFolderId | |
Write-Output $GetPod | |
} | |
} | |
end | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment