Introduction to “PowerShell Module to Play Music”:
This is in continuation to one of my previous blog post wherein I wrote a script to play random songs in the background using the Powershell console.
Though there are already some Windows Media player automation scripts available in the community, I was looking for something that as easy as “Single cmdlet” and provides easy controls like Shuffle, Loop, Stop, ShowPlayList and Filter hence I wrote this script myself.
Video Demo:
Functionalities:
I’ve included few more functionalities to the script which are following
- Plays in background
Plays all music in the background on a hidden Windows Media Player Instance and you can continue with your work.
- Filter Audio Files
- Music Controls
Enables you to Control your music from the Shell no need to switch windows, by providing options like- Shuffle
- Loop
- Stop
- Shuffle
- Now Playing Notifications
You get notified by an Information balloon in the bottom right corner of your screen whenever a new audio starts playing. This balloon will pop up every time one audio ends and a new one starts. - Stores\Caches last accessed directory
This function caches/stores information of last accessed directory in a temporary file so that you don’t have to provide Music directory every time you run the function
- Displays information and user preferences
Provides information like Number of Songs that will be played, Total Play duration, and Mode chosen by the user in the PowerShell console itself. - Support Switch aliasesAll music control switches and parameters support Aliases for all those lazy people out there 😛
How it works (The Core Logic):
Installation:
-
- On PowerShell v5.x: You can install the MusicPlayer module directly from the PowerShell Gallery
- On PowerShell v4 and Earlier:
- On PowerShell v5.x: You can install the MusicPlayer module directly from the PowerShell Gallery
GitHub Repository [Fork it!]:
Get the complete script from my GitHub Repository here
Hoping you’ll find it fun and useful, cheers.. signing off…
Prateek Singh
Engineer. Blogger. Science and Technology fan.
Ridiculously Curious and a compulsive Book reader.
Related posts
4 Comments
Leave a ReplyCancel reply
Categories
Author of Books
Awards
Open Sourced Projects
Author at
Blog Roll
Mike F RobbinsDamien Van Robaeys
Stéphane van Gulick
Kevin Marquette
Adam Bertram
Stephanos Constantinou
Francois-Xavier Cat
Ravikanth Chaganti
Roman Levchenko
Blog Stats
- 1,131,799 People Reached
[…] on July 18, 2016 submitted by /u/Prateeksingh1590 [link] [comments] Leave a […]
I liked this feature exposed in powershell, I would like to suggest and improve the feature in music Player.
this code not able schedule from windows task, there are anyway do that?
Hi,
I wanted to ask you a question, how could I make every time I start windows with a random song and once the song is finished, I will close the player?
it should only sound a song and stop automatically, as if it were an introduction to the system.