diff --git a/centreon/common/powershell/wsus/serverstatistics.pm b/centreon/common/powershell/wsus/serverstatistics.pm index 8d166ad91..a28f1d7b9 100644 --- a/centreon/common/powershell/wsus/serverstatistics.pm +++ b/centreon/common/powershell/wsus/serverstatistics.pm @@ -22,6 +22,7 @@ package centreon::common::powershell::wsus::serverstatistics; use strict; use warnings; +use centreon::common::powershell::functions; sub get_powershell { my (%options) = @_; @@ -32,7 +33,12 @@ sub get_powershell { my $ps = ' $culture = new-object "System.Globalization.CultureInfo" "en-us" [System.Threading.Thread]::CurrentThread.CurrentUICulture = $culture +'; + $ps .= centreon::common::powershell::functions::escape_jsonstring(%options); + $ps .= centreon::common::powershell::functions::convert_to_json(%options); + + $ps .= ' $wsusServer = "' . $options{wsus_server} . '" $useSsl = ' . $options{use_ssl} . ' $wsusPort = ' . $options{wsus_port} . ' diff --git a/centreon/common/powershell/wsus/synchronisationstatus.pm b/centreon/common/powershell/wsus/synchronisationstatus.pm index 8fab99bb2..ef88e710c 100644 --- a/centreon/common/powershell/wsus/synchronisationstatus.pm +++ b/centreon/common/powershell/wsus/synchronisationstatus.pm @@ -22,6 +22,7 @@ package centreon::common::powershell::wsus::synchronisationstatus; use strict; use warnings; +use centreon::common::powershell::functions; sub get_powershell { my (%options) = @_;