PowerShell Script Fixup

The PowerShell Script Fixup enables you to specify PowerShell scripts to be executed before and after the launch of an application. This will be an ideal fixup to apply to an application if you have any first time run tasks to be executed upon launching of an application to the first time and perform any cleanup tasks on closing the application.

To add a PowerShell Script Fixup, perform the following steps:

To add PowerShell Script Fixup:

1. Select an application in the Applications node, click the Apply button in the MSIX Editor ribbon, and then select PowerShell Script Fixup from the menu.

Note:You could also select an application, right click, and select Apply PowerShell Script Fixup from the context menu.

The PowerShell Script Fixup Configuration view opens.

2. Enter the following information:

Property

Description

Executable

This property displays the executable that will be invoked when the application is launched. This is a non-editable property.

Arguments

Specify the command-line arguments that you wish to pass to executable of an application upon its launch.

Working Directory

This property displays the working directory of the application. This is a non-editable property.

Script Execution Mode

Provide the execution mode of the PowerShell script as a part of Start Script or End Script. Select one of the following:

ExecutionPolicy RemoteSigned
ExecutionPolicy AllSigned
ExecutionPolicy Bypass
ExecutionPolicy Default
ExecutionPolicy Restricted
ExecutionPolicy RemoteSigned
ExecutionPolicy Undefined
ExecutionPolicy Unrestricted

Stop on Start Script Error

If you select this check box, the Application will not be launched if the Start Script encounters an error.

Start Script

Fill in the following fields to define the start script, a PowerShell script that will be run prior to launching of an application:

Script Path: Click the ellipses (...) to browse for a PowerShell script file (ps1) that should be executed upon launch of the application.
Arguments: Specify the arguments to be passed to the PowerShell start script specified in the Script Path property. Use of pseudo-variables or environment variables are supported.
Show PowerShell Window: If you select the check box, the PowerShell Window will be displayed during the execution of the script. By default it is unchecked.
Run Once: If you select the check box, the script will run only when you run launch application for the first time. By default it is unchecked.
Wait for Script to Finish: If you select the check box, launching of the application will be delayed until the start script execution is complete or a timeout occurs.
Timeout (s): Set the maximum number of seconds to wait for the script to finish. If a timeout occurs it is treated as an error for the purpose of Stop on Script Error. The value 0 means an immediate timeout, if you do not want a timeout do not specify a value.

Note:Applicable only if you set Wait for Script to Finish option to True.

End Script

Fill in the following fields to define the end script, a PowerShell script that will be run after closing an application:

Script Path: Click the ellipses (...) to browse for a PowerShell script file (ps1) that should be executed upon launch of the application.
Arguments: Specify the arguments to be passed to the PowerShell start script specified in the Script Path property. Use of pseudo-variables or environment variables are supported.
Show PowerShell Window: If you select the check box, the PowerShell Window will be displayed during the execution of the script. By default it is unchecked.
Run Once: If you select the check box, the script will run only when you run launch application for the first time. By default it is unchecked.
3. After adding the above fields, click Update button.
4. Click Save or Save As in the ribbon for the change to take effect.

Note:One of the following three properties must to specified to apply a PowerShell Script Fixup: Arguments, Start Script Path, and End Script Path.

Note:Only one PowerShell Script Fixup can be applied to an application.