Skip to content

Instantly share code, notes, and snippets.

@bazzilic
Last active November 9, 2017 09:34
Show Gist options
  • Save bazzilic/859f95946ac4ecd306b6406cc9f8d8fa to your computer and use it in GitHub Desktop.
Save bazzilic/859f95946ac4ecd306b6406cc9f8d8fa to your computer and use it in GitHub Desktop.
Put hostname and some server information on the background of a Windows server
# iex ((New-Object System.Net.WebClient).DownloadString('https://gist.github.com/bazzilic/859f95946ac4ecd306b6406cc9f8d8fa/raw/020730d36e6b8517466334e715116467d4f2aa7d/Set-WinSrvBackground.ps1'))
New-TemporaryFile | `
% { iwr -Uri https://download.sysinternals.com/files/BGInfo.zip -OutFile $_.FullName ; `
mv $_.FullName "$($_.FullName).zip" ; `
"$($_.FullName).zip" } | `
% { Expand-Archive -Path $_ -DestinationPath ~/bginfo/ -Force }
New-TemporaryFile | `
% { iwr -Uri https://gist.github.com/bazzilic/859f95946ac4ecd306b6406cc9f8d8fa/raw/1c9b6b02663850d04c2f007d7b51a2ebda592f70/x.bgi -OutFile "$($_.FullName).bgi" ; `
~/bginfo/bginfo64 "$($_.FullName).bgi" /timer 0 /silent /nolicprompt ;
Start-Sleep -s 1 ;
rmdir -force -recurse ~/bginfo }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment