Convert Argument
to string explicitly
This commit is contained in:
parent
55043420aa
commit
8d7835a8aa
|
@ -51,7 +51,7 @@ $null = New-Module {
|
|||
#>
|
||||
function Enable-OneShotListener {
|
||||
$tempTask = "PortValhalla Temp";
|
||||
$action = New-ScheduledTaskAction -Execute "pwsh" -Argument (Get-StartupArguments);
|
||||
$action = New-ScheduledTaskAction -Execute "pwsh" -Argument ([string](Get-StartupArguments));
|
||||
schtasks /Create /SC ONEVENT /EC $logName /MO "*[System[Provider[@Name='$logName'] and EventID=$($oneShotTrigger)]]" /TR cmd.exe /TN $tempTask;
|
||||
$trigger = (Get-ScheduledTask $tempTask).Triggers;
|
||||
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest;
|
||||
|
|
Loading…
Reference in a new issue