This will eject the physical drive tray of all available “CD Drive” devices.
$sh = New-Object -ComObject "Shell.Application"
$sh.Namespace(17).Items() | Where-Object { $_.Type -eq "CD Drive" } | foreach { $_.InvokeVerb("Eject") }
February 7, 2025
This will eject the physical drive tray of all available “CD Drive” devices.
$sh = New-Object -ComObject "Shell.Application"
$sh.Namespace(17).Items() | Where-Object { $_.Type -eq "CD Drive" } | foreach { $_.InvokeVerb("Eject") }