Bing Search Images using PowerShell Module for Azure Cognitive Services

In this demo, PowerShell Module for Azure Cognitive Service is utilized to programmatically Bing Search Images with a Keyword, then results are analyzed and filtered by emotion (happiness) scores and saved as local files.

Project Page –

Steps involved

  1. Install the PSCognitiveService module from PowerShell Gallery and Import it in your current session

  2. Create AzureRM Cognitive Service Accounts for subscription keys

  3. Configure the Subscription keys as $env variables locally in your session and add it to your $profile for later usage. Which will complete the setup and configuration.
  4. Search the web for a keyword to find Images and capture the Image URLs

  5. Detect emotion in each image using cmdlet: Get-Face and get the Happiness scores

  6. Use this happiness score filter out Images with a score above 90%.
  7. Analyze the Images with cmdlet: Get-ImageAnalysis to get caption text.
  8. Use the caption to locally save the image on your file system with a unique name that describes the Image.
  9. and you’re done! 🙂


If you like this video, please subscribe to my youtube channel here which is the motivation for me to create more such videos 🙂 thank you!


Optical Character Recognition

Subscribe to our mailing list

* indicates required