mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-31 11:16:12 +02:00
Updated play-system-sounds.ps1
This commit is contained in:
parent
e2eed4e802
commit
cb9df2ccf2
@ -21,9 +21,12 @@ function PlaySoundFiles([string]$filePattern) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if ($IsLinux -or $IsMacOS) { throw "Currently only supported for Windows" }
|
||||||
|
|
||||||
$WinDir = Resolve-Path "$env:WINDIR"
|
$WinDir = Resolve-Path "$env:WINDIR"
|
||||||
if (-not(Test-Path "$WinDir" -pathType container)) { throw "Windows directory at 📂$Path doesn't exist" }
|
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"
|
||||||
PlaySoundFiles "$WinDir\Media\*\*.wav"
|
PlaySoundFiles "$WinDir\Media\*\*.wav"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
|
Loading…
Reference in New Issue
Block a user