en-us/about_FM_callbacks.txt

TOPIC
    about_FM_callbacks
     
SHORT DESCRIPTION
    Explains how the callback feature works.
     
LONG DESCRIPTION
    Callbacks are a system in the ForestManagement module that allows the caller to register a
    scriptblock that will be executed at the beginning of each command that applies configuration
    settings or tests for compliance.
    This allows integrating logic, for example to validate configuration, prompt for user choice
    or other integrated logic.
 
    When running one of those commands, all callbacks will sequentially be called. Keep execution
    time in mind, as this might cause a significant delay in execution, especially when chaining
    multiple commands!
    Any uncaught exception in any scriptblock will cause the execution to fail.
 
    The scriptblocks will each receive four arguments:
    - The Server targeted (if any)
    - The credentials used to do the targeting (if any)
    - The Forest the two earlier pieces of information map to (if any)
    - The Domain the two earlier pieces of information map to (if any)
    Any and all of these pieces of information may be empty.
 
    Commands to manage the callbacks:
    - Register-FMCallback
    - Get-FMCallback
    - Unregister-FMCallback
 
    Internally, each Test-* and Invoke-* command should call Invoke-Callback as part of its begin
    block.
 
KEYWORDS
    ForestManagement callback