Skip to content

Instantly share code, notes, and snippets.

@SQLDBAWithABeard
SQLDBAWithABeard / profile.ps1
Last active November 30, 2020 18:32
Prompt
[System.Console]::OutputEncoding = [System.Text.Encoding]::ASCII
# borrowing heavily from https://dbatools.io/prompt but formatting the execution time without using the DbaTimeSpanPretty C# type
function Prompt {
if($PSVersionTable.PSVersion.Major -eq 6){
Write-Host (Get-Date -Format "PS 6 ") -ForegroundColor Yellow -NoNewline
}
elseif($PSVersionTable.PSVersion.Major -eq 5){
Write-Host (Get-Date -Format "PS 5 ") -ForegroundColor Yellow -NoNewline
}
elseif($PSVersionTable.PSVersion.Major -eq 7){
@azpat
azpat / Get-FaceBookPictures.ps1
Created September 19, 2013 02:27
Get-FacebookPictures.ps1
#First, Get an Access Token from here: https://developers.facebook.com/tools/explorer
# More info here: http://stackoverflow.com/questions/4219580/is-it-possible-to-download-all-of-my-photos-on-facebook-through-facebook-graph-a
# See Also: https://github.com/mhowsden/get_albums.py
# Assumes C:\temp\facebookpics exists - this version doesn't make or check or anything fancy like that.
$accesstoken="YOURACCESSTOKENGOESHERE"
$response = Invoke-WebRequest -Uri "https://graph.facebook.com/me/albums?access_token=$accesstoken"
if ($response.StatusCode -ne 200){Write-Error "Failed to connect to FaceBook Graph API"}
else{
$data = convertfrom-json $response.Content
$albums = $data.data