update fix deadcode, security

This commit is contained in:
baodev0
2026-09-28 08:26:29 +07:00
parent 3af59bd9c5
commit 82080b5b84
452 changed files with 4857 additions and 26289 deletions
@@ -3,6 +3,7 @@
namespace App\Http\Services\vCenter;
use App\Support\Cache\CacheKey;
use App\Support\PowerShellEscaper;
use App\Support\TlsHttpClientFactory;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;
@@ -72,7 +73,7 @@ class SnapshotService
Log::channel('Custom')->info("===================================================================");
Log::channel('Custom')->info("Create Snapshot with VirtualMachine Name - $vmName - Snap #$name");
$command = "& 'C:\CLISave\createsnapshot.ps1' -vm_name '$vmName' -name '$name'";
$command = "& 'C:\CLISave\createsnapshot.ps1' -vm_name " . PowerShellEscaper::singleQuote($vmName) . ' -name ' . PowerShellEscaper::singleQuote($name);
Log::channel('Custom')->info($command);
$cmdResult = $this->powerShellService->executePowerCLI($command);
@@ -309,7 +310,7 @@ class SnapshotService
Log::channel('Custom')->info("Remove Snapshot with VirtualMachine Name - $vmware_name - Snap #$snap");
Log::channel('Custom')->info("\r\n");
$Command = "& 'C:\CLISave\deletesnap.ps1' -vm_name '$vmware_name' -name '$snap'";
$Command = "& 'C:\CLISave\deletesnap.ps1' -vm_name " . PowerShellEscaper::singleQuote($vmware_name) . ' -name ' . PowerShellEscaper::singleQuote((string) $snap);
Log::channel('Custom')->info("$Command");
@@ -376,7 +377,7 @@ class SnapshotService
Log::channel('Custom')->info("Revert Snapshot with VirtualMachine Name - $vmware_name - Snap #$snap");
Log::channel('Custom')->info("\r\n");
$Command = "& 'C:\CLISave\backSnap.ps1' -vm_name '$vmware_name' -name '$snap'";
$Command = "& 'C:\CLISave\backSnap.ps1' -vm_name " . PowerShellEscaper::singleQuote($vmware_name) . ' -name ' . PowerShellEscaper::singleQuote((string) $snap);
Log::channel('Custom')->info("$Command");