Last active
April 26, 2021 07:03
-
-
Save the-louie/ad35fa119827c315c0cc77ca7a3c45d9 to your computer and use it in GitHub Desktop.
Copy random image and use as Teams background
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
<# | |
This script will pick a random jpeg from '$HOME\Pictures\teams-bg\' and copy it to the | |
Teams background image folder. | |
To make it work, save this script somewhere and then rename *any* jpeg-image to 'stdbg.jpg' and | |
use it as a custom background in teams. This file will be overwritten with the ranom background | |
image everytime the script executes. | |
Then create a new scheduled task to execute 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' with | |
the argument: | |
-command "PATH-TO-YOUR-SCRIPT\random-copy.ps1" | |
/// Louie 2021-04-23 | |
#> | |
$FILENAME = Get-ChildItem "$HOME\Pictures\teams-bg\*.jpg" | resolve-path | get-random -count 1 | |
Copy-Item $FILENAME -destination "$HOME\Appdata\Roaming\Microsoft\Teams\Backgrounds\Uploads\stdbg.jpg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment