Anstatt "@()" für das "$share" Objekt kannst du "[PSCustomObject]@{}" verwenden.
$shares = @()
Get-WmiObject Win32_ClusterShare -ComputerName fileserver | ForEach-Object {
$share = [PSCustomObject]@{
Name = $_.Name
Path = $_.Path
}
$shares += $share
}
$shares