While useful, this script does not run on PowerShell Core because it relies on Windows constructs like $env:temp.