Skip to content

Instantly share code, notes, and snippets.

View elav000's full-sized avatar

Evan Lavender elav000

  • Microsoft
  • Redmond, WA
View GitHub Profile
@elav000
elav000 / TerminalBingImage.ps1
Last active April 24, 2020 13:29
A small PowerShell script to get the en-US Bing image of the day and update the current user's profiles.json's default backgroundImage setting
# $TODO: - These should be cmdlet parameters if you go that far...
$bingRootUrl = "https://www.bing.com"
$marketLocale = "en-US"
$numberOfImages = 1
$bingImageInfoUrl = "$bingRootUrl/HPImageArchive.aspx?format=js&idx=0&n=$numberOfImages&mkt=$marketLocale"
# Windows Terminal profiles.json location
$profilesJsonLocation = "$env:USERPROFILE\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json"
function Get-ImageOfTheDayUrl {