Skip to content

Instantly share code, notes, and snippets.

@schoenwaldnils
Created August 15, 2021 22:12
Show Gist options
  • Save schoenwaldnils/07d148193d727296ec79ae446f2cf63b to your computer and use it in GitHub Desktop.
Save schoenwaldnils/07d148193d727296ec79ae446f2cf63b to your computer and use it in GitHub Desktop.
Powershell script to update latest playing track - Virtual DJ
# 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