Updated play-system-sounds.ps1

This commit is contained in:
Markus Fleschutz 2024-04-25 07:16:48 +02:00
parent e2eed4e802
commit cb9df2ccf2

View File

@ -21,9 +21,12 @@ function PlaySoundFiles([string]$filePattern) {
}
try {
if ($IsLinux -or $IsMacOS) { throw "Currently only supported for Windows" }
$WinDir = Resolve-Path "$env:WINDIR"
if (-not(Test-Path "$WinDir" -pathType container)) { throw "Windows directory at 📂$Path doesn't exist" }
Write-Host "`n Windows System Sounds at $WinDir\Media" -foregroundColor green
PlaySoundFiles "$WinDir\Media\*.wav"
PlaySoundFiles "$WinDir\Media\*\*.wav"
exit 0 # success