diff --git a/src/chocolatey/GetChocolatey.cs b/src/chocolatey/GetChocolatey.cs
index 29a097e95a..c4f0657d46 100644
--- a/src/chocolatey/GetChocolatey.cs
+++ b/src/chocolatey/GetChocolatey.cs
@@ -331,7 +331,7 @@ public int ListCount()
}
///
- /// Gets the configuration. Should be used purely for informational purposes
+ /// Gets a copy of the configuration. Any changes here will have no effect as this is provided purely for informational purposes.
///
/// The configuration for Chocolatey
/// Only call this once you have registered all container components with Chocolatey
@@ -339,7 +339,14 @@ public ChocolateyConfiguration GetConfiguration()
{
ensure_environment();
- return create_configuration(new List());
+ // ensure_original_configuration() already calls create_configuration()
+ // so no need to repeat, just grab the result
+ var configuration = ensure_original_configuration(
+ new List(),
+ (config) => config
+ );
+
+ return configuration;
}
private void ensure_original_configuration(IList args, Action action)