Last active
June 22, 2019 14:40
-
-
Save HerbCaudill/ea8710410afc9bb88a65f846e46d04da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$taskName = 'Enter hours at logon' | |
# Path to Chrome on your machine | |
$chrome = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' | |
# URL of your tab of the spreadsheet | |
$url = 'https://docs.google.com/spreadsheets/d/ASDFasdf12341234asdfASDFASFD1234/edit#gid=12341234' | |
$taskXml = @" | |
<?xml version="1.0" encoding="UTF-16"?> | |
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
<Triggers> | |
<LogonTrigger> | |
<Enabled>true</Enabled> | |
</LogonTrigger> | |
<SessionStateChangeTrigger> | |
<Enabled>true</Enabled> | |
<StateChange>SessionUnlock</StateChange> | |
</SessionStateChangeTrigger> | |
</Triggers> | |
<Actions Context="Author"> | |
<Exec> | |
<Command>$chrome</Command> | |
<Arguments>--app=$url</Arguments> | |
</Exec> | |
</Actions> | |
</Task> | |
"@ | |
Register-ScheduledTask -TaskName $taskName -Xml $taskXml -Force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment