我在将引号放在引号内时遇到问题

I have problem with putting quotes inside quotes

我正在尝试在 PowerShell 中创建一行命令来下载音乐文件并每 1 小时执行一次
Start-Process -WindowStyle Hidden PowerShell "Register-ScheduledTask Regedit -Action (New-ScheduledTaskAction -Execute PowerShell -Argument "Start-process -WindowStyle Hidden PowerShell '(New-Object System.Media.SoundPlayer C:\Windows\Jjgw.wav).PlaySync()'") -Trigger (New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Hours 1)) -f;(New-Object System.Net.WebClient).DownloadFile('https://github.com/User/Repository/raw/master/Music.wav','C:\Windows\Music.wav')"
但我无法设置 single/double 引用到最后,而不是最接近的引用。
我正在尝试实现这样的目标:
PowerShell ""command1";"command2""
只执行这两个命令。

这个问题经常被问到。最好的方法是使用 EncodedCommand:

$command = {
    $action = New-ScheduledTaskAction -Execute PowerShell -Argument "Start-process -WindowStyle Hidden PowerShell '(New-Object System.Media.SoundPlayer C:\Windows\Jjgw.wav).PlaySync()'"
    $trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Hours 1)
    Register-ScheduledTask Regedit -Action $action -Trigger $trigger -Force
    (New-Object System.Net.WebClient).DownloadFile('https://github.com/User/Repository/raw/master/Music.wav','C:\Windows\Music.wav')
}
$encodedCommand = [convert]::ToBase64String([System.Text.encoding]::Unicode.GetBytes($command.ToString())) 
Start-Process -WindowStyle Hidden PowerShell -ArgumentList "-EncodedCommand", $encodedCommand