Skip to content

Instantly share code, notes, and snippets.

@ArtisanByteCrafter
Last active June 9, 2020 06:05
Show Gist options
  • Save ArtisanByteCrafter/8484feec2a5751add706b5b5fe9ee35f to your computer and use it in GitHub Desktop.
Save ArtisanByteCrafter/8484feec2a5751add706b5b5fe9ee35f to your computer and use it in GitHub Desktop.
gets the status codes of a ghost blog's public urls
[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