Posted On April 2, 2019

PowerShell: How to Play a Sound

kimconnect 0 comments
blog.KimConnect.com >> Codes >> PowerShell: How to Play a Sound
$soundFile="C:\Windows\media\tada.wav"
$sound = new-Object System.Media.SoundPlayer
$sound.SoundLocation=$soundFile
$sound.Play()

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

How To Invoke Functions as Background Jobs

Invoke-Command, Start-Job, Multi-Tasking is what good coders should aspire toward. Here, we're looking at some…

PowerShell: How to Logoff an User RDP Session

# logOffUser.ps1 $servername=$env:computername $userName='brucelee' function logOffRdpSession{ param( $serverName=$env:computername, $username ) $username=if($username -match '\\'){[regex]::match($username,'\\(.*)$').captures.groups.value[1] }else{ $username.tostring()…

WordPress Plugin Syntax Highlighter Fix

Source: from a forum poster of this plugin's Github page. // Add this to functions.php…