Created
August 15, 2021 22:12
-
-
Save schoenwaldnils/07d148193d727296ec79ae446f2cf63b to your computer and use it in GitHub Desktop.
Powershell script to update latest playing track - Virtual DJ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this file into C:\Users\<USER>\Documents\VirtualDJ\History | |
# | |
# To Allow PowerShell-Scripts: | |
# | |
# Open Pwershell and run: | |
# Set-ExecutionPolicy remotesigned | |
# | |
# and: | |
# Unblock-File updatePlayNow.ps1 | |
# | |
# then run this script (right click 'Run with PowerShell') | |
function UpdateFile { | |
[cmdletbinding()] | |
param( | |
[parameter( | |
Mandatory = $true, | |
ValueFromPipeline = $true)] | |
$pipelineInput | |
) | |
Begin { | |
Clear-Content now-playing.txt | |
} | |
Process { | |
$pipelineInput | Out-File -FilePath now-playing.txt -Encoding utf8 | |
Write-Host $pipelineInput | |
} | |
End { | |
} | |
} | |
Get-content tracklist.txt -Tail 1 -Wait | UpdateFile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment