{"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>$languageTags = @(<br>&#8220;en-US&#8221;, # English (US)<br>&#8220;en-GB&#8221;, # English (UK)<br>&#8220;es-ES&#8221;, # Spanish (Spain)<br>&#8220;ca-ES&#8221;, # Catalan (Spain)<br>&#8220;fr-FR&#8221;, # French (France)<br>&#8220;de-DE&#8221; # 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>$currentLangs = Get-WinUserLanguageList | ForEach-Object { $_.LanguageTag }<\/p>\n\n\n\n<p>foreach ($lang in $languageTags) {<br>Write-Host &#8220;? Processant $lang\u2026&#8221; -ForegroundColor Cyan<br>try {<br># Afegeix l&#8217;idioma si no hi \u00e9s<br>if (-not ($currentLangs -contains $lang)) {<br>Write-Host &#8220;\u2795 Afegint idioma $lang\u2026&#8221;<br>$langList = Get-WinUserLanguageList<br>$langList.Add($lang)<br>Set-WinUserLanguageList $langList -Force<br>} else {<br>Write-Host &#8220;\u2714\ufe0f L&#8217;idioma $lang ja est\u00e0 instal\u00b7lat.&#8221;<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>}<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Mostra les veus disponibles al final<\/h1>\n\n\n\n<p>Write-Host &#8220;`n? Veus SAPI instal\u00b7lades:&#8221; -ForegroundColor Yellow<br>Add-Type -AssemblyName System.Speech<br>(New-Object System.Speech.Synthesis.SpeechSynthesizer).GetInstalledVoices() |<br>ForEach-Object { &#8220;\u2022 &#8221; + $_.VoiceInfo.Name }<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Idiomes i veus que vols instal\u00b7lar $languageTags = @(&#8220;en-US&#8221;, # English (US)&#8220;en-GB&#8221;, # English (UK)&#8220;es-ES&#8221;, # Spanish (Spain)&#8220;ca-ES&#8221;, # Catalan (Spain)&#8220;fr-FR&#8221;, # French (France)&#8220;de-DE&#8221; # 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}]}}