From aaf946c992da1284fcb0bc940c0c246db53a71d7 Mon Sep 17 00:00:00 2001 From: Alex Kup <116945542+Lifailon@users.noreply.github.com> Date: Thu, 18 Jan 2024 18:52:11 +0300 Subject: [PATCH] Delete Scripts/Get-GoogleTranslate.psm1 --- Scripts/Get-GoogleTranslate.psm1 | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 Scripts/Get-GoogleTranslate.psm1 diff --git a/Scripts/Get-GoogleTranslate.psm1 b/Scripts/Get-GoogleTranslate.psm1 deleted file mode 100644 index a90dd59..0000000 --- a/Scripts/Get-GoogleTranslate.psm1 +++ /dev/null @@ -1,21 +0,0 @@ -function Get-Translate { - param ( - $data, - $key = "KEY" # Get https://cloud.google.com/translate/docs/reference/rest - ) - $url = "https://translation.googleapis.com/language/translate/v2?key=$key" - $body = @{ - q = $data - target = "ru" - source = "en" - } | ConvertTo-Json - try { - $response = Invoke-RestMethod -Uri $url -Method POST -ContentType "application/json" -Body $body - $translation = $response.data.translations[0].translatedText - return $translation - } catch { - Write-Output "Error: $($_.Exception.Message)" - } -} - -# Get-Translate -data "What is your name" \ No newline at end of file