Custom Module Configuration not working I have the following file.


  modules/custom/test_module/config/install/test_module.settings.yml


test_module.settings:
    message: 'Hello'
    langcode: 'en'


But I am not able to get the following value.

$config = \Drupal::config('test_module.settings');
print $config-&gt;get('message');    


I have referred this link.

UPDATE:

Removing test_module.settings: line solved the issue.
test_module.settings:
    message: 'Hello'
    langcode: 'en'


Is that really content of your file? It should only contain:

message: 'Hello'
langcode: 'en'


Also, Configuration on config/install is only imported when a module is installed. If it is an existing module, you need to re-install it or write an update function to initialize the configuration.

You can always use something like print_r($config->get()) to see everything in your config file.