Replace C# invocations with Invoke-Command

This commit is contained in:
Manuel Thalmann 2024-03-22 15:25:00 +01:00
parent 5e6eebf8ad
commit 5290d3283a

View file

@ -83,11 +83,11 @@ function Enable-UACNextLogin([Context] $context) {
[System.Tuple]::Create(
$autoLoginTrigger,
$autoLoginName,
"{ $((Get-AutoLoginScript)) }.Invoke($autoLoginTrigger, '$contextScript', '$preparedUsernameProperty', '$preparedPasswordProperty')")
"Invoke-Command { $((Get-AutoLoginScript)) } -ArgumentList @($autoLoginTrigger, '$contextScript', '$preparedUsernameProperty', '$preparedPasswordProperty')")
[System.Tuple]::Create(
$uacDisablerTrigger,
$uacDisablerName,
"{ $((Get-UACDisablerScript)) }.Invoke($uacDisablerTrigger, '$contextScript', '$autoLoginName', '$uacDisablerName', '$autoLoginTriggerProperty', '$uacDisablerTriggerProperty')"));
"Invoke-Command { $((Get-UACDisablerScript)) } -ArgumentList @($uacDisablerTrigger, '$contextScript', '$autoLoginName', '$uacDisablerName', '$autoLoginTriggerProperty', '$uacDisablerTriggerProperty')"));
foreach ($options in $optionCollection) {
$action = New-ScheduledTaskAction -Execute "pwsh.exe" -Argument (