Skip to content

Commit

Permalink
Merge pull request #109 from liamjbennett/windows_scheduledtask
Browse files Browse the repository at this point in the history
adding support for the windows scheduled task
  • Loading branch information
mizzy committed May 7, 2014
2 parents 9acda72 + 0440a26 commit aee598f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function FindScheduledTask
{
param($name)

$task = schtasks /query /v /fo csv /TN "$name" | ConvertFrom-CSV
return $task
}
7 changes: 7 additions & 0 deletions lib/specinfra/command/windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@ def check_iis_app_pool_dotnet(name, dotnet)
end
end

def check_scheduled_task(name)
Backend::PowerShell::Command.new do
using 'find_scheduled_task.ps1'
exec "(FindScheduledTask -name '#{name}').TaskName -eq '\\#{name}'"
end
end

private

def item_has_attribute item, attribute
Expand Down

0 comments on commit aee598f

Please sign in to comment.