Enhancement Requests

Aug 22, 2013 at 4:18 AM
Couple of things that would be handy to have within the FIMSyncPowershelModule.psm1;
  • Clear Run Historry
  • Pending Exports
  • Start MA If Pending Export
Currently I use you module and add the following functions at the top of my PS file;
Function PendingExport
{
    Param
    (        
        [parameter(Mandatory=$true, ValueFromPipeline = $true)]              
        $ManagementAgent
    )

    $MAcount = Get-ManagementAgentCounts $ManagementAgent
    $PendExpCnt = [int]$MAcount.NumExportAdd + [int]$MAcount.NumExportDelete + [int]$MAcount.NumExportUpdate
    $rtnval = $PendExpCnt -gt 0
    [bool]$rtnval
}

Function StartMAIfPendingExport
{
    Param
    (        
        [parameter(Mandatory=$true, ValueFromPipeline = $true)]              
        $ManagementAgent,
                
        [parameter(Mandatory=$true, ValueFromPipeline = $true)]              
        $RunProfile,
        
        [Switch]
        $AsJob
    )
    If(PendingExport $ManagementAgent){
        if ($AsJob)
        {
            Start-ManagementAgent $ManagementAgent $RunProfile -AsJob
        }
        else
        {
            Start-ManagementAgent $ManagementAgent $RunProfile 
        }
    }
    
}