diff --git a/src/chocolatey/infrastructure.app/services/IPowershellService.cs b/src/chocolatey/infrastructure.app/services/IPowershellService.cs index 1dd30b2090..5e19da6c2d 100644 --- a/src/chocolatey/infrastructure.app/services/IPowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/IPowershellService.cs @@ -1,4 +1,4 @@ -// Copyright © 2017 - 2021 Chocolatey Software, Inc +// Copyright © 2017 - 2021 Chocolatey Software, Inc // Copyright © 2011 - 2017 RealDimensions Software, LLC // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -68,6 +68,10 @@ public interface IPowershellService bool before_modify(ChocolateyConfiguration configuration, PackageResult packageResult); void prepare_powershell_environment(IPackage package, ChocolateyConfiguration configuration, string packageDirectory); + + [Obsolete("This version of running the powershell host do not support running additional hooks. Use the appropriate overload instead")] + PowerShellExecutionResults run_host(ChocolateyConfiguration config, string chocoPowerShellScript, Action additionalActionsBeforeScript); + PowerShellExecutionResults run_host(ChocolateyConfiguration config, string chocoPowerShellScript, Action additionalActionsBeforeScript, IEnumerable hookPreScriptPathList, IEnumerable hookPostScriptPathList); } } diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index 8390cb2ae7..dba64d54fc 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -1,4 +1,4 @@ -// Copyright © 2017 - 2021 Chocolatey Software, Inc +// Copyright © 2017 - 2021 Chocolatey Software, Inc // Copyright © 2011 - 2017 RealDimensions Software, LLC // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -593,6 +593,12 @@ private void remove_assembly_resolver() } } + [Obsolete("This version of running the powershell host do not support running additional hooks. Use the appropriate overload instead")] + public PowerShellExecutionResults run_host(ChocolateyConfiguration config, string chocoPowershellScript, Action additionalActionsBeforeScript) + { + return run_host(config, chocoPowershellScript, additionalActionsBeforeScript, Enumerable.Empty(), Enumerable.Empty()); + } + public PowerShellExecutionResults run_host(ChocolateyConfiguration config, string chocoPowerShellScript, Action additionalActionsBeforeScript, IEnumerable hookPreScriptPathList, IEnumerable hookPostScriptPathList) { // since we control output in the host, always set these true