From 8d7835a8aa6fd15e6b9beae4c6d08aa37244b1e5 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 16 Aug 2024 23:03:19 +0200 Subject: [PATCH] Convert `Argument` to string explicitly --- scripts/Common/Scripts/Operations.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Common/Scripts/Operations.ps1 b/scripts/Common/Scripts/Operations.ps1 index fdc487e4..09095ad1 100644 --- a/scripts/Common/Scripts/Operations.ps1 +++ b/scripts/Common/Scripts/Operations.ps1 @@ -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;