![Windows PowerShell:如何通过 Windows 10 设置和运行 TTS 语言下载](https://linux22.com/image/1580466/Windows%20PowerShell%EF%BC%9A%E5%A6%82%E4%BD%95%E9%80%9A%E8%BF%87%20Windows%2010%20%E8%AE%BE%E7%BD%AE%E5%92%8C%E8%BF%90%E8%A1%8C%20TTS%20%E8%AF%AD%E8%A8%80%E4%B8%8B%E8%BD%BD.png)
我想在 Windows 10 上安装语言语音。
使用[Windows PowerShell]
(参见此链接) 并使用以下命令可以在 Windows 10 中添加新语言:
PS C:\> $OldList = Get-WinUserLanguageList
PS C:\> $OldList.Add("fr-FR")
PS C:\> Set-WinUserLanguageList -LanguageList $OldList
结果将会是这样的: Windows 区域/语言设置
但这只是第一步,因为必须下载语言包。
如何下载并安装 TTS 语音?
提前致谢
答案1
无论您想要下载什么文件,使用 PowerShell 下载都是一样的。
1. Invoke-WebRequest
The first and most obvious option is the Invoke-WebRequest cmdlet. It is built into PowerShell and can be used in the following method:
Invoke-WebRequest -Uri $url -OutFile $output
2. System.Net.WebClient
A common .NET class used for downloading files is the System.Net.WebClient class.
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $output)
3. Start-BitsTransfer
If you haven't heard of BITS before, check this out. BITS is primarily designed for asynchronous file downloads, but works perfectly fine synchronously too (assuming you have BITS enabled).
Start-BitsTransfer -Source $url -Destination $output -Asynchronous
安装只是使用 PowerShell 的 cmdlet 来启动安装程序。
Start-Process -FilePath 'PathToInstaller'