Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (19 sloc) 621 Bytes
function IsSystem32Bit()
{
return
($Env:PROCESSOR_ARCHITECTURE -eq 'x86') -and `
($Env:PROCESSOR_ARCHITEW6432 -eq $null)
}
function Invoke-ScheduledTask() {
param(
[string] $name,
[string] $executable,
[string] $arguments
)
$action = New-ScheduledTaskAction -Execute $executable -Argument $arguments
$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date)
Register-ScheduledTask -TaskName $name -Action $action -Trigger $trigger
Start-ScheduledTask -TaskName $name
Start-Sleep -s 1
Unregister-ScheduledTask -TaskName $name -Confirm:$false
}