Skip to content

Commit 8894a2f

Browse files
authored
Update new-scheduledtask.md
Added New-ScheduledTaskPrincipal to $P assignment in sample code.
1 parent 8e0645a commit 8894a2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docset/windows/scheduledtasks/new-scheduledtask.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ You can register a task to run any of the following application or file types: W
4242
```
4343
PS C:\> $A = New-ScheduledTaskAction -Execute "Taskmgr.exe"
4444
PS C:\> $T = New-ScheduledTaskTrigger -AtLogon
45-
PS C:\> $P = "Contoso\Administrator"
45+
PS C:\> $P = New-ScheduledTaskPrincipal "Contoso\Administrator"
4646
PS C:\> $S = New-ScheduledTaskSettingsSet
4747
PS C:\> $D = New-ScheduledTask -Action $A -Principal $P -Trigger $T -Settings $S
4848
PS C:\> Register-ScheduledTask T1 -InputObject $D

0 commit comments

Comments
 (0)