Patch/Cmdlets/NAV/Get-AdjacentInstances.ps1
function Get-AdjacentInstances { [CmdletBinding()] param ( $MainInstance ) process { $current = Get-NAVApplication $MainInstance Get-NAVServerInstance | Where-Object -Property State -EQ -Value "Running" | % { $app = Get-NAVApplication $_.ServerInstance if ($_.ServerInstance -notlike "*`$$MainInstance") { if ($app.'Database server' -eq $current.'Database server' -and $app.'Database name' -eq $current.'Database name') { $_.ServerInstance } } } } } Export-ModuleMember -Function Get-AdjacentInstances |