{"id":16472,"date":"2025-07-02T11:29:39","date_gmt":"2025-07-02T09:29:39","guid":{"rendered":"https:\/\/www.beseit.net\/?p=16472"},"modified":"2025-10-23T08:10:38","modified_gmt":"2025-10-23T06:10:38","slug":"%f0%9f%9b%a0%ef%b8%8f-script-powershell-complet-i-robust-per-installar-veus-onecore","status":"publish","type":"post","link":"http:\/\/www.beseit.net\/?p=16472","title":{"rendered":"?\ufe0f Script PowerShell complet i robust per instal\u00b7lar veus OneCore"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"957\" height=\"313\" src=\"https:\/\/www.beseit.net\/wp-content\/uploads\/2025\/07\/image-5.png\" alt=\"\" class=\"wp-image-16863\" srcset=\"http:\/\/www.beseit.net\/wp-content\/uploads\/2025\/07\/image-5.png 957w, http:\/\/www.beseit.net\/wp-content\/uploads\/2025\/07\/image-5-300x98.png 300w, http:\/\/www.beseit.net\/wp-content\/uploads\/2025\/07\/image-5-768x251.png 768w, http:\/\/www.beseit.net\/wp-content\/uploads\/2025\/07\/image-5-500x164.png 500w\" sizes=\"auto, (max-width: 957px) 100vw, 957px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>powershell:\n\nSet-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass\nC:\\tts\\instal\u00b7la-veus-onecore.ps1\n<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">Idiomes i veus que vols instal\u00b7lar<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">$languageTags = @(<br>\u00aben-US\u00bb, # English (US)<br>\u00aben-GB\u00bb, # English (UK)<br>\u00abes-ES\u00bb, # Spanish (Spain)<br>\u00abca-ES\u00bb, # Catalan (Spain)<br>\u00abfr-FR\u00bb, # French (France)<br>\u00abde-DE\u00bb # German<br>)<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Obt\u00e9 la llista actual d&#8217;idiomes<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">$currentLangs = Get-WinUserLanguageList | ForEach-Object { $_.LanguageTag }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">foreach ($lang in $languageTags) {<br>Write-Host \u00ab? Processant $lang\u2026\u00bb -ForegroundColor Cyan<br>try {<br># Afegeix l&#8217;idioma si no hi \u00e9s<br>if (-not ($currentLangs -contains $lang)) {<br>Write-Host \u00ab\u2795 Afegint idioma $lang\u2026\u00bb<br>$langList = Get-WinUserLanguageList<br>$langList.Add($lang)<br>Set-WinUserLanguageList $langList -Force<br>} else {<br>Write-Host \u00ab\u2714\ufe0f L&#8217;idioma $lang ja est\u00e0 instal\u00b7lat.\u00bb<br>}<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    # Comprova si la veu b\u00e0sica ja est\u00e0 instal\u00b7lada\n    $capability = \"Language.$lang~Basic~~~\"\n    $installed = Get-WindowsCapability -Online | Where-Object { $_.Name -eq $capability }\n    if ($installed.State -ne \"Installed\") {\n        Write-Host \"\u2b07\ufe0f Instal\u00b7lant veu b\u00e0sica per a $lang...\"\n        Add-WindowsCapability -Online -Name $capability -ErrorAction Stop\n    } else {\n        Write-Host \"\u2714\ufe0f Veu b\u00e0sica ja instal\u00b7lada per a $lang.\"\n    }\n\n    # Instal\u00b7la reconeixement de veu si no hi \u00e9s\n    $speechCap = \"Language.$lang~Speech~~~\"\n    $speechInstalled = Get-WindowsCapability -Online | Where-Object { $_.Name -eq $speechCap }\n    if ($speechInstalled.State -ne \"Installed\") {\n        Write-Host \"?\ufe0f Instal\u00b7lant reconeixement de veu per a $lang...\"\n        Add-WindowsCapability -Online -Name $speechCap -ErrorAction SilentlyContinue\n    } else {\n        Write-Host \"\u2714\ufe0f Reconeixement de veu ja instal\u00b7lat per a $lang.\"\n    }\n\n} catch {\n   Write-Warning (\"Error instal\u00b7lant per a $lang: \" + $_.Exception.Message)\n\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">}<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Mostra les veus disponibles al final<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Write-Host \u00ab`n? Veus SAPI instal\u00b7lades:\u00bb -ForegroundColor Yellow<br>Add-Type -AssemblyName System.Speech<br>(New-Object System.Speech.Synthesis.SpeechSynthesizer).GetInstalledVoices() |<br>ForEach-Object { \u00ab\u2022 \u00bb + $_.VoiceInfo.Name }<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Idiomes i veus que vols instal\u00b7lar $languageTags = @(\u00aben-US\u00bb, # English (US)\u00aben-GB\u00bb, # English (UK)\u00abes-ES\u00bb, # Spanish (Spain)\u00abca-ES\u00bb, # Catalan (Spain)\u00abfr-FR\u00bb, # French (France)\u00abde-DE\u00bb # German) Obt\u00e9 la llista actual d&#8217;idiomes $currentLangs = Get-WinUserLanguageList | ForEach-Object { $_.LanguageTag } foreach &hellip; <a href=\"http:\/\/www.beseit.net\/?p=16472\">Continua llegint <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":3169,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[185],"tags":[],"class_list":["post-16472","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-veus"],"_links":{"self":[{"href":"http:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/posts\/16472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.beseit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16472"}],"version-history":[{"count":3,"href":"http:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/posts\/16472\/revisions"}],"predecessor-version":[{"id":16866,"href":"http:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/posts\/16472\/revisions\/16866"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/media\/3169"}],"wp:attachment":[{"href":"http:\/\/www.beseit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.beseit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16472"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.beseit.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}