Skip to content

Instantly share code, notes, and snippets.

@dtkloud
Last active September 7, 2016 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtkloud/756f7c0701aae8e1100abc86fbd42264 to your computer and use it in GitHub Desktop.
Save dtkloud/756f7c0701aae8e1100abc86fbd42264 to your computer and use it in GitHub Desktop.
$subkey = 'yourCVAPIKey'
$filepath = 'C:\temp\DanThom_Profile.jpg'
$Splat = @{
Uri= "https://api.projectoxford.ai/vision/v1.0/analyze?visualFeatures=Adult"
Method = 'Post'
InFile = $filepath
ContentType = 'application/octet-stream'
Headers = @{'Ocp-Apim-Subscription-Key' = $subkey}
}
$NSFW = (Invoke-RestMethod @Splat).adult.isAdultContent
$NSFW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment