Skip to content

Instantly share code, notes, and snippets.

@joeypiccola
Last active February 28, 2017 15:49
Show Gist options
  • Save joeypiccola/9d0701b2b4637dd8ec9123e46434df38 to your computer and use it in GitHub Desktop.
Save joeypiccola/9d0701b2b4637dd8ec9123e46434df38 to your computer and use it in GitHub Desktop.
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