Automate Tasks with IPowerShell: Utilizing Attached Script Files

Automate Tasks with IPowerShell: Utilizing Attached Script Files

Kenneth Lv8

Automate Tasks with IPowerShell: Utilizing Attached Script Files

Table of Contents

Disclaimer: This post includes affiliate links

If you click on a link and make a purchase, I may receive a commission at no extra cost to you.

IPowershellAttachedScriptFile

https://techidaily.com

Declaration

IPowershellAttachedScriptFile : ICustomAction

https://techidaily.com

Overview

This interface facilitates editing custom action that allows launching an attached Powershell script file into execution.

Properties

String ScriptFileSource - Gets or sets the source path to the attached script file.

Bool Is32Bit - Gets or sets the property of the custom action to run the 32-bit PowerShell executable. If Is64Bit value is also “true” then runs the Operating System bitness PowerShell executable (32-bit on x86 operating systems, 64-bit on x64).

Bool Is64Bit - Gets or sets the property of the custom action to run the 32-bit PowerShell executable. If Is32Bit value is also “true” then runs the Operating System bitness PowerShell executable (32-bit on x86 operating systems, 64-bit on x64).

Examples

  $advinst = new-object -com AdvancedInstaller

$project = $advinst.CreateProjectS(“architect”)
$custAct = $project.CustomActionsComponent.NewPowershellAttachedScriptFile(“D:\my_script.ps1”)

https://techidaily.com

Set “Is32Bit” and “Is64Bit” properties to true to auto detect OS bitness PowerShell executable

$custAct.Is32Bit = $true
$custAct.Is64Bit = $true

Copy
https://techidaily.com

See also

ISearch

IAdvinstProjectTypes

Did you find this page useful?

Please give it a rating:

Thanks!

Report a problem on this page

Information is incorrect or missing

Information is unclear or confusing

Something else

Can you tell us what’s wrong?

Send message

Also read:

  • Title: Automate Tasks with IPowerShell: Utilizing Attached Script Files
  • Author: Kenneth
  • Created at : 2024-10-10 02:44:22
  • Updated at : 2024-10-11 02:38:15
  • Link: https://fox-sys.techidaily.com/automate-tasks-with-ipowershell-utilizing-attached-script-files/
  • License: This work is licensed under CC BY-NC-SA 4.0.