This file contains hidden or 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
| [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){ |
This file contains hidden or 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
| #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 |