Created
January 15, 2020 18:11
-
-
Save aadennis/5175939c9561d80920e0c8f135a24438 to your computer and use it in GitHub Desktop.
The specifics differ depending on the app. Originally, this was so I could cache OneNote documents (Onenote.exe /r)
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
$root = "C:\OneDrive\data" | |
$WordExe = "C:\Program Files (x86)\Microsoft Office\root\Office16\winword.exe" | |
cd $root | |
$dir = gci -r *.docx | |
$dir | |
$dir | % { | |
$note = $_ | |
$fn = $note.FullName | |
"Currently on $fn" | |
& $WordExe $fn | |
sleep 6 | |
Get-Process | Where-Object -Property Name -eq "WINWORD" | kill | |
sleep 6 | |
} | |
cd C:\PowerShell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment