Having issues making a simple script in powershell run windows media player in the background -
I am trying to do a simple script where I want to run only part of my script to run in the background. I want to run Windows Media Player in the background. I'm normally new to power and script, under the entire belt the entire one and a half days. Can anyone help me and can explain in basic terms how the initial job works with Invoke-item Thank you for your help.
This is my original script. I wanted to launch a powerpoint and a little bit after loading my media player. I know that I can do it in powerpoint, but I am using it to experiment and learn. I've got to do this work:
# call SSD $ MusicPath = "C: \ powershell \ Windows_Exclamation.wav" $ Powerpoint = "C: \ powershell \ SSD.ppsx" invoke- Item $ Powerpoint Early Sleep 3s-item $ MusicPath I wanted a media player to run in the background. Even my script is:
# call SSD $ MusicPath = "C: \ powershell \ Windows_Exclamation.wav" $ PowerPoint = "C: \ powershell \ SSD.pptx" invoke- Item $ powerpoint start-sleep-s3 start-job-script block {invoke-item} $ musicpath Should I use avow-command or am I lost in sauce here ?
I am using a MediaSoundPlayer object. path = "C: \ Windows \ Media \ Windows Exclamation.wav" function PlayWav ($ path) {(New object media. Soundplayer "$ path"). Play ();} PlayWav -Path "$ MusicPath"
Comments
Post a Comment