Create Dummy Files for Testing
Pretty hard to pick on this, looks pretty nice already!

You have this duplicated pattern though:


if (-not(Test-Path $filepath)){
    New-Item -ItemType file -Path $filepath -Value $i
}
# ...
if (-not(Test-Path $queue_filepath)){
    New-Item -ItemType file -Path $queue_filepath -Value $value
}



You could create a function that takes $path and $value and use it twice instead of duplicating code.

And the comments are pointless, your code already speaks for itself (nice!), so just delete them!

Other than these nitpicks, I don't see a better way to do what you want.