For the complete documentation index, see llms.txt. This page is also available as Markdown.

RunScript

Executes a PowerShell script from a file or the script parameter.

Task version: 1.2.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

Parameters : PowerShellParameter[]

Parameters for the script, provided switch parameters need to have a boolean value

Default: - Example: foo, bar

ReadFromFile : Boolean

Should the script be read from a file or from the Script parameter

Default: False Example: false

ScriptFilePath : String

Location for the script file.

Default: - Example: c:\temp\example.ps1

Script : String

Location for the script file.

Default: - Example: c:\temp\example.ps1

LogInformationStream : Boolean

Should the information stream be logged. If false, log will be an empty string.

If set to true, a lot of string data may be logged. Use with caution.

Default: - Example: true

Task Result

Name
Description

Result : IList<Object>

Result. Example: {Property1=Value1; Property2=Value2}

Errors : IList<String>

Error(s). Example: "at , C:\temp\sample.ps1: line 1: The term 'foo' is not recognized..."

Log : String

Log. Example: foo bar

Task Changelog

Changelog for Task Frends.PowerShell.RunScript.

[1.2.0] - 2024-10-09

Changed

  • Added explicit reference to Microsoft.Management.Infrastructure

[1.1.0] - 2024-10-08

Changed

  • Updated PowerShell version to 7.2.23

[1.0.2] - 2022-12-21

Changed

  • Memory leak fix.

[1.0.1] - 2022-03-04

Changed

  • Targeting changed to only include .NET 6.0 (removed .NET Standard 2.0)

[1.0.0] - 2022-02-25

Added

  • Initial implementation

Last updated

Was this helpful?