PortValhalla/scripts/Windows/Scripts/Scripting.ps1

17 lines
416 B
PowerShell

<#
.SYNOPSIS
Converts the specified value into a form to safle inject it into a script.
.PARAMETER value
The value to convert for injection.
#>
function ConvertTo-Injection {
param(
$Value
)
"([System.Text.Encoding]::Default.GetString([System.Convert]::FromBase64String('$(
[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($value))
)')))"
}