Files
portal-api/app/Support/PowerShellEscaper.php
2026-09-27 11:42:40 +07:00

17 lines
358 B
PHP

<?php
namespace App\Support;
final class PowerShellEscaper
{
public static function singleQuote(string $value): string
{
return "'" . str_replace("'", "''", $value) . "'";
}
public static function encodedCommand(string $script): string
{
return base64_encode(mb_convert_encoding($script, 'UTF-16LE', 'UTF-8'));
}
}