Last active
June 9, 2020 06:05
-
-
Save ArtisanByteCrafter/8484feec2a5751add706b5b5fe9ee35f to your computer and use it in GitHub Desktop.
gets the status codes of a ghost blog's public urls
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
[string] $Site = 'https://www.example.com' | |
[string] $ApiKey = '123456' | |
$posts = (Invoke-RestMethod -Uri "$Site/ghost/api/v2/content/posts/?key=$ApiKey").posts.url | |
$posts | Foreach-Object { | |
[PSCustomObject]@{ | |
'Url'=$_ | |
'StatusCode'=(iwr -Uri $_).StatusCode | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment