Skip to content

Instantly share code, notes, and snippets.

@codeisafourletter
codeisafourletter / RecoverPSGallery.ps1
Created February 1, 2018 14:11 — forked from guitarrapc/RecoverPSGallery.ps1
Whom you miss PSGallery with Get-PSRepository!
Register-PSRepository -Name PSGallery -SourceLocation https://www.powershellgallery.com/api/v2/ -PublishLocation https://www.powershellgallery.com/api/v2/package/ -ScriptSourceLocation https://www.powershellgallery.com/api/v2/items/psscript/ -ScriptPublishLocation https://www.powershellgallery.com/api/v2/package/ -InstallationPolicy Trusted -PackageManagementProvider NuGet
#!/bin/bash
binary=$(which adb)
filename=$HOME/screen_$(date +"%H%M%S").png
if [ -e $binary ]
then
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png $filename
adb shell rm /sdcard/screen.png
echo "Screenshot written to $filename"