How can handle principal/mirror status in for-each and switch condition in powershell : i am new in powershell i have one query 


    	# Load SMO extension
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null;
    
    # Servers to check
    #$sqlservers = @("$svr","$svr\$inst");
    $sqlservers = get-content 'servers.txt'
    foreach($server in $sqlservers)
    {
    $srv = New-Object "Microsoft.SqlServer.Management.Smo.Server" $server;
    # Get mirrored databases
    $databases = $srv.Databases | Where-Object {$_.IsMirroringEnabled -eq $true}; 
    
    
    #Write-Host $databases;
    Write-Host "==================================";
    # $test= $databases | Select-Object -Property Name, MirroringStatus| Format-Table -AutoSize;
     $databases | Select-Object -Property  MirroringStatus | Format-Table -AutoSize ;
     Foreach ($status in $databases) {Switch ($databases.MirroringPartnerInstance) 
     {
    1{ $status. + "Disconnected" } 
    2{ $status. + "Suspended" } 
    2{ $status. + "Synchronizing" } 
    3{ $status. + "Not Synchronized" }
    
        }
    }

i want code like this is some one know pls help me it is an urgent 