Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Windows on Azure example template#7469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
spikecurtis merged 6 commits intomainfromspike/azure-windows
May 10, 2023
Merged

Conversation

@spikecurtis
Copy link
Contributor

No description provided.

Signed-off-by: Spike Curtis <spike@coder.com>
Signed-off-by: Spike Curtis <spike@coder.com>
Signed-off-by: Spike Curtis <spike@coder.com>
Signed-off-by: Spike Curtis <spike@coder.com>
Comment on lines +61 to +69
Out-File -FilePath "C:\AzureData\CoderAgent.ps1" -InputObject $init_script
$task = @{
TaskName = 'CoderAgent'
Action = (New-ScheduledTaskAction -Execute 'powershell.exe' -Argument '-sta -ExecutionPolicy Unrestricted -Command "C:\AzureData\CoderAgent.ps1 *>> C:\AzureData\CoderAgent.log"')
Trigger = (New-ScheduledTaskTrigger -AtStartup), (New-ScheduledTaskTrigger -Once -At (Get-Date).AddSeconds(15))
Settings = (New-ScheduledTaskSettingsSet -DontStopOnIdleEnd -ExecutionTimeLimit ([TimeSpan]::FromDays(3650)) -Compatibility Win8)
Principal = (New-ScheduledTaskPrincipal -UserId 'vm\coder' -RunLevel Highest -LogonType S4U)
}
Register-ScheduledTask @task -Force
Copy link
Member

@bpmctbpmctMay 9, 2023
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Does line 61 start the agent once? Line 65 is also intended to do this (it runs the agent after the task is registered 15 seconds later)

I feel like we should only have one.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Line 61 writes the script to a file, line 69 registers the task that runs the script.

Line 65 is just defining the trigger(s) for the task, which are then used as args for Line 69.

bpmct reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ah, understood :)

Signed-off-by: Spike Curtis <spike@coder.com>
Signed-off-by: Spike Curtis <spike@coder.com>
@spikecurtisspikecurtisenabled auto-merge (squash)May 10, 2023 05:46
@spikecurtisspikecurtis merged commitd35a458 intomainMay 10, 2023
@spikecurtisspikecurtis deleted the spike/azure-windows branchMay 10, 2023 05:56
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 10, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@bpmctbpmctbpmct approved these changes

Assignees

@spikecurtisspikecurtis

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@spikecurtis@bpmct

[8]ページ先頭

©2009-2025 Movatter.jp