.ext
with the prog id progId
. I copied this function from the excellent work of Danysys and the github repository PS-SFTA and then slightly adapted it for my purposes set-winFileExtAssociation png PBrush # associate .png with MS Paint set-winFileExtAssociation .sql applications\code.exe