(view source code of cdeject.ps as plain text)
param( [string] $help )
if ( $help -eq "" ) {
if ( $HOME[0] -eq "/" ) {
# Linux
eject
} else {
# Windows
$colCDROMs = ( new-object -COM WMPlayer.OCX.7 ).cdromCollection
for ( $i = 0; $i -lt $colCDROMs.count ; $i++ ) { $colCDROMs.Item( $i ).eject( ) }
}
}
else {
write-host
write-host "CDEject.ps1, Version 1.01"
write-host "Eject all CDROMs"
write-host
write-host "Requires Windows Media Player in Windows."
Write-Host "Uses native `"eject`" command in Linux."
write-host
write-host "Windows code based on VBScript code posted by Christoph Fricke"
write-host "in the microsoft.public.de.german.scripting.wsh newsgroup"
write-host
write-host "Written by Rob van der Woude"
write-host "http://www.robvanderwoude.com"
write-host
}
page last modified: 2024-04-16; loaded in 0.0081 seconds