File Associations

Associate files with PowerShell Scripts

Download this Lecture Docs

In this lecture, we look at how to create file associations with PowerShell Universal Desktop mode. We'll assign a script to the .ps2 file extension and run a script when the file is opened.

Example Code from this lecture

FileAssociation.ps1

param($File)

$Json = Get-Content $File | ConvertFrom-Json 
$Json

file.ps2

{
    "Name": "Adam"
}