en-US/about_POSHOrigin_Using_Credentials.help.txt

TOPIC
    about_POSHOrigin_Using_Credentials
    
SHORT DESCRIPTION
    In a POSHOrigin configuration file, you normally define credentials needed by the DSC resource inline with the rest of the resource options and
    use Get-POSHOriginSecret to resolve the credential.
    
LONG DESCRIPTION
    In a POSHOrigin configuration file, you normally define credentials needed by the DSC resource inline with the rest of the resource options and
    use Get-POSHOriginSecret to resolve the credential. When using a defaults file (.psd1) however, you can not run scripts or cmdlets. To get
    around this problem, you define a 'Secrets' hashtable in your defaults file (or your configuration file) and list all the needed information to
    resolve your credentials using the resolvers. Internally, POSHOrigin will inspect the Secrets entry, resolve the credentials and add them to your
    configuration object.
    
EXAMPLES
    Defining credentials for the **POSHOrigin_vSphere:VM** resource.

    vm_defaults.psd1
    ================

    @{
        secrets = @{
            vCenterCredentials = @{
                resolver = 'passwordstate'
                options = @{
                endpoint = 'https://passwordstate.mydomain.com/api'
                credApiKey = '<your API key>'
                passwordId = 1234
                }
            }
            guestCredentials = @{
                resolver = 'pscredential'
                options = @{
                    username = 'administrator'
                    password = 'K33p1t53cR3tK33p1t5@fE'
                }
            }
        }
    }

    The above is equivalent to using [Get-POSHOriginSecret] in the configuration file like so.

    resource 'POSHOrigin_vSphere:VM' 'VM01' @{
        ###
        # Other options omitted for brevity
        ###
        vcenterCredentials = Get-POSHOriginSecret 'passwordstate' @{
            endpoint = 'https://passwordstate.mydomain.com/api'
            credApiKey = '<your API key>'
            passwordId = 1234
        }
        GuestCredentials= Get-POSHOriginSecret 'pscredential' @{
            username = 'administrator'
            password = 'K33p1t53cR3tK33p1t5@fE'
        }
    }

    Defining credentials for the **POSHOrigin_NetScaler:LBServer** resource.

    ns_defaults.psd1
    ================

    @{
        secrets = @{
            credential = @{
                resolver = 'pscredential'
                options = @{
                    username = 'admin'
                    password = '<your password>'
                }
            }
        }
    }

KEYWORDS
    POSHOrigin

SEE ALSO
    about_POSHOrigin
    about_POSHOrigin_Configuration_File
    about_POSHOrigin_Defaults_File
    about_POSHOrigin_Executing_Configurations
    about_POSHOrigin_Loading_Configurations
    about_POSHOrigin_Resolver_PSCredential
    about_POSHOrigin_Resolver_PasswordState
    about_POSHOrigin_Resolver_ProtectedData
    about_POSHOrigin_Sharing_Configurations
    about_POSHOrigin_Testing_Configurations
    aboot_POSHOrigin_Using_Resolvers
    https://github.com/devblackops/POSHOrigin/wiki