The script is available for download from https://gallery.technet.microsoft.com//How-to-set-default-printer-cf89670b. You can also use Microsoft Script Browser for Windows PowerShell ISE to download the sample with one button click from within your scripting environment.
This PowerShell script shows how to set default printer in Windows.
In real world, we usually have multiple printers in our company environment. IT admins want to user regularly use specified printer, they have to let user to pick one as default printer.
You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery