en-us/about_dbatools_importoptions.help.txt

TOPIC
    about_dbatools_importoptions
    
SHORT DESCRIPTION
    Explains the various options of how to import dbatools.
    
LONG DESCRIPTION
    Welcome to our guide to importing dbatools. Since one glove fits NOT all,
    we have implemented various ways in which you can import the module. These
    options may have security implications, may be more aimed at developers, or
    may reduce resource need in return for slower import times.
    
    All these settings can be set by variable or registry key, making it
    possible to enforce these settings by policy.
    
    
    #-------------------------------------------------------------------------#
    # Index #
    #-------------------------------------------------------------------------#
    
    - Configuring settings
    - Serial import
    
    
    #-------------------------------------------------------------------------#
    # Configuring settings #
    #-------------------------------------------------------------------------#
    
    Import settings can be set at three levels:
    
    - Per Script
    - Per User
    - Per Computer
    
    Per Script:
    When configured per script, declare the respective 'dbatools_XXXXX' variable
    to $true before import. The variable name is listed with the description of
    the individual options.
    Note that this must be done BEFORE importing dbatools. If the script is
    called from a powershell process that has dbatools already installed, it
    will be ignored and have no effect.
    
    Alternatively, you can provide a Hashtable of arguments when importing dbatools,
    for instance

        Import-Module dbatools -ArgumentList @{SerialImport=$true}
    
    Per User:
    The individual settings are DWORD properties found in the following key:
    
      HKCU:\SOFTWARE\Microsoft\WindowsPowerShell\dbatools\System
    
    The value name is listed with the description of the individual options.
    Set the value to '1' in order to enable the option.
    
    Per Computer:
    The individual settings are DWORD properties found in the following key:
    
      HKLM:\SOFTWARE\Microsoft\WindowsPowerShell\dbatools\System
    
    The value name is listed with the description of the individual options.
    Set the value to '1' in order to enable the option.
    
    Note on competing settings:
    This system works on an anybody-in basis. Meaning that if any single setting
    enables an import option, the others cannot disable the setting. A script
    that has been set to import serial will do so, even if the registry settings
    are explicitly set to '0'.
    
    
    #-------------------------------------------------------------------------#
    # Serial import #
    #-------------------------------------------------------------------------#

      $dbatools_dotsourcemodule = $true | SerialImport: 1

    In order to optimize import speed, dbatools loads its components in
    parallel. This places a heavy load on CPU however. Since import speed isn't
    that important on unattended scripts, it is recommended to enable serial
    import for them, avoiding CPU spikes.

    Note: The variable name is $dbatools_dotsourcemodule (legacy naming) but
    the registry key is SerialImport. Both enable the same serial import
    behavior.
    
    
KEYWORDS
    dbatools import