{"id":18995884,"url":"https://github.com/prateekkumarsingh/pscognitiveservice","last_synced_at":"2025-04-22T13:48:56.113Z","repository":{"id":88584439,"uuid":"53955528","full_name":"PrateekKumarSingh/PSCognitiveService","owner":"PrateekKumarSingh","description":"Powershell module to access Microsoft Azure Machine learning RESTful API's or Microsoft cognitive services","archived":false,"fork":false,"pushed_at":"2019-09-16T16:59:14.000Z","size":28178,"stargazers_count":50,"open_issues_count":1,"forks_count":9,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-17T03:08:00.467Z","etag":null,"topics":["azure","emotion","entity","face","gender","image-analysis","keyphrases","microsoft-cognitive-services","powershell","sentiment","vision"],"latest_commit_sha":null,"homepage":"http://RidiCurious.com","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PrateekKumarSingh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-03-15T15:21:38.000Z","updated_at":"2024-12-29T06:01:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"38907d62-220e-4c77-b667-5b9183869d83","html_url":"https://github.com/PrateekKumarSingh/PSCognitiveService","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrateekKumarSingh%2FPSCognitiveService","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrateekKumarSingh%2FPSCognitiveService/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrateekKumarSingh%2FPSCognitiveService/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrateekKumarSingh%2FPSCognitiveService/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PrateekKumarSingh","download_url":"https://codeload.github.com/PrateekKumarSingh/PSCognitiveService/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250252063,"owners_count":21399931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","emotion","entity","face","gender","image-analysis","keyphrases","microsoft-cognitive-services","powershell","sentiment","vision"],"created_at":"2024-11-08T17:33:12.016Z","updated_at":"2025-04-22T13:48:56.087Z","avatar_url":"https://github.com/PrateekKumarSingh.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build status](https://ci.appveyor.com/api/projects/status/jgiom7ww0nhc5kt7?svg=true)](https://ci.appveyor.com/project/PrateekKumarSingh/pscognitiveservice) \n[![PowershellGallery](https://img.shields.io/powershellgallery/v/PSCognitiveService.svg)](https://www.powershellgallery.com/packages/PSCognitiveService)\n\n# PowerShell Module for Microsoft Cognitive Services (aka, ProjectOxford)\n\u003ca href='https://www.microsoft.com/cognitive-services'\u003eMicrosoft Cognitive Services\u003c/a\u003e are some machine learning Artificial intelligent REST API's to give Human-like cognition abilities to your applications.\n\n\n# What this module can do?\n\n\u003cimg src=https://raw.githubusercontent.com/PrateekKumarSingh/PSCognitiveService/master/Media/demo.gif width=100% height=90%\u003e\n\n```PowerShell\n# install module\nInstall-Module PSCognitiveService -Force -Scope CurrentUser -Verbose\n\n# import module\nImport-Module PSCognitiveService -Force -Verbose\n\n# get module\nGet-Command -Module PSCognitiveService\n\n# login and obtain subscription keys, local config\nNew-LocalConfiguration -FromAzure -AddKeysToProfile | Out-Null\n\n# face features \u0026 emotion recognitionc\nGet-Face -Path 'C:\\tmp\\Bill.jpg' |Format-List *\n\n# image analysis\nGet-ImageAnalysis -Path 'C:\\tmp\\Bill.jpg'\n\n# image description\nGet-ImageDescription -Path 'C:\\tmp\\Bill.jpg' | ForEach-Object Description | Format-List\n\n# tag image and convert to hashtags\nGet-ImageTag -URL https://goo.gl/Q73Qtw |\nForEach-Object{$_.tags.name} | ForEach-Object {'#'+$_ -join ' '}\n\n# optical character recognition\nGet-ImageText -URL https://goo.gl/XyP6LJ |\nForEach-Object {$_.regions.lines.words.text -join ' '}\n\n# convert to thumbnail\nConvertTo-Thumbnail -URL https://goo.gl/XyP6LJ -SmartCropping\n\n# bing search\nSearch-Web 'powershell 6.1' -c 3 |\nForEach-Object {$_.webpages.value} | Format-List name, url, snippet\nSearch-Entity -Text 'brad pitt' |\nForEach-Object {$_.entities.value} | Format-List name, description, image, webSearchUrl\n\n# text analytics\nGet-Sentiment -Text \"Hey good morning!\",\"Such a wonderful day\",\"I feel sad about you\" |  ForEach-Object documents\nGet-KeyPhrase -Text \"Hey good morning!\",\"Such a wonderful day\",\"I feel sad about these poor people\" | ForEach-Object documents\nTrace-Language -Text \"Hey good morning!\", \"Bonjour tout le monde\", \"La carretera estaba atascada\" | ForEach-Object {$_.documents.detectedlanguages}\n\n# moderate content - text, image (path/url)\nTest-AdultRacyContent -Text \"Hello World\" | ForEach-Object Classification # clean\nTest-AdultRacyContent -Text \"go eff yourself\" | ForEach-Object Classification # not good/review required\nTest-AdultRacyContent -Path 'C:\\Tmp\\test.png'\nTest-AdultRacyContent -URL https://goo.gl/uY2PS6\n\n```\n\n\n# Pre-Requisites\nYou need to do one-time registration for each Microsoft Cognitive Services API from \u003ca href=\"https://www.microsoft.com/cognitive-services/en-us/sign-up\"\u003eHERE\u003c/a\u003e, before start using the module, because it won’t work without an API Key.\n\n## 1. Installation\n\n### [PowerShell v5](https://www.microsoft.com/en-us/download/details.aspx?id=50395) and Later\nYou can install the `PSCognitiveService` module directly from the PowerShell Gallery\n\n\u003cimg src=https://raw.githubusercontent.com/PrateekKumarSingh/PSCognitiveService/master/Media/Install.jpg width=100% height=90%\u003e\n\n* **[Recommended]** Install to your personal PowerShell Modules folder\n```PowerShell\nInstall-Module PSCognitiveService -scope CurrentUser\n```\n* **[Requires Elevation]** Install for Everyone (computer PowerShell Modules folder)\n```PowerShell\nInstall-Module PSCognitiveService\n```\n### PowerShell v4 and Earlier\nTo install to your personal modules folder run:\n```PowerShell\niex (new-object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/PrateekKumarSingh/PSCognitiveService/master/Install.ps1')\n```\n\n## 2. Subscribe\nMicrosoft Cognitive services are offered and subscribed through the \u003ca href ='https://portal.azure.com'\u003eAzure Portal\u003c/a\u003e to achieve that -\n\n- **Create cognitive service accounts** in azure portal.\n- **Obtain subscription keys** \n- **Set $Env variables** locally, which would consumed by the module cmdlets to make REST API call's.\n\nPersonally, going to azure portal and obtaining subscription keys is a turn down for me. \n\nBut, ```New-CognitiveServiceAccount```cmdlet that is included in this module to create Azure cognitive service accounts/subscription from your console.\n\nExample, if you want to use the ```Search-Web``` cmdlet that utlizes ```Bing Search``` capabilities, you need to subscribe to Cognitive Service account of type: ```Bing.Search.v7```, just run the below cmdlet.\n\n```PowerShell\nNew-CognitiveServiceAccount -AccountType Bing.Search.v7\n\n# alternatively, specify ResourceGroup, Location and SKU\nNew-CognitiveServiceAccount -AccountType ComputerVision -ResourceGroupName ResourceGroup1 -Location centralindia -SKUName S1\n```\n\n## 3. Configure Locally\n\nAlright, you are now subscribed, but how to obtain the subscription key(s) and set-up ```$ENV``` variable(s) in the session to run these cmdlets. \n\nIt is as simple as a below cmdlet and Kaboom! you are subscribed and local configuration is complete!\n\n```PowerShell\nNew-LocalConfiguration -FromAzure -AddKeysToProfile -Verbose\n```\n**NOTE** - Please add the subscription keys to your ```$Profile``` using ```-AddKeysToProfile``` switch for future use and to avoid above configuration step.\n\n\u003cimg src=https://raw.githubusercontent.com/PrateekKumarSingh/PSCognitiveService/master/Media/Subscribe.gif width=100% height=90%\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprateekkumarsingh%2Fpscognitiveservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprateekkumarsingh%2Fpscognitiveservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprateekkumarsingh%2Fpscognitiveservice/lists"}