将音乐复制到 Ipod

jus*_*inf 1 powershell itunes ipod powershell-2.0

我想知道是否有办法使用 powershell 将音乐复制到 ipod。

如果需要,我不介意必须在我的电脑上安装 iTunes。我不想将我的 ipod 与 itunes 同步或将文件添加到 itunes 库中。

我现在复制音乐的方式是,我只需选择包含我想要的音乐的文件夹,然后在 iTunes 中将其拖到我的 ipod 上。这样它就不会将音乐添加到 iTunes 库中。

jus*_*inf 5

我设法弄明白了

$IpodName = "type the name of your ipod hear as it apears in itunes"
$SongToCopy = 'c:\tools\test\04.mp3'

#Create a com object to talk to Itunes and List the Librarys
    $iTunes = New-Object -ComObject iTunes.Application
    $LibrarySource = $iTunes.sources

$IpodSource = $LibrarySource.ItemByName($IpodName)

$IpodPlaylists = $IpodSource.Playlists
$IpodPlaylist  = $IpodPlaylists.ItemByName($IpodName)
$IpodTracks    = $IpodPlaylist.Tracks

$IpodTracks.Count

$IpodPlaylist.AddFile($SongToCopy)

$IpodTracks.Count
Run Code Online (Sandbox Code Playgroud)