diff --git "a/Fun\\Random/USB Connect & Disconnect Sound.ps1" "b/Fun\\Random/USB Connect & Disconnect Sound.ps1" new file mode 100644 index 0000000..d3a8d2e --- /dev/null +++ "b/Fun\\Random/USB Connect & Disconnect Sound.ps1" @@ -0,0 +1,44 @@ +<# +Author: Gabe Kerntke +Date: 03-10-2025 + +.Synopsis + +.Modified +2025-03-10 (GabeK) - Original script created + +#> + +# Variables # + +$soundPlayer = New-Object System.Media.SoundPlayer +$DisconnectSound = "C:\Windows\Media\Windows Hardware Remove.wav" +$ConnectSound = "C:\Windows\Media\Windows Hardware Insert.wav" + +# Functions # + +Function USBSound { + $soundPlayer.SoundLocation = $DisconnectSound + $soundPlayer.Play() + + Start-Sleep 2 + + $soundPlayer.SoundLocation = $ConnectSound + $soundPlayer.Play() +} + +Function LoopUSBSound { + for ($i = 0; $i -lt 3; $i++) { + Start-Sleep 5 + USBSound + } +} + +# Start Script # + +Add-Type -AssemblyName System.Windows.Forms +Add-Type -AssemblyName PresentationFramework + +LoopUSBSound + +# End Script # \ No newline at end of file