File Associations
Launch PowerShell scripts based on file associations.
File associations in the admin console.

Define a File Association

File associations are stored within the fileAssociations.ps1 file within the configuration directory. You can use the New-PSUFileAssociation cmdlet to define associations directly.
By default, you'll need to include the script to run and the extension to associate with it.
1
New-PSUFileAssociation -Script FileAssociation.ps1 -Extension .ps3
Copied!

Accessing the File Path

By default, you can use the $File parameter within your script to access the full path to the file that caused the file association to trigger.
1
param($File)
2
3
$Json = Get-Content $File | ConvertFrom-Json
Copied!