Inline Functions

Functions to be used in measure section variable.

Requirement: Rainmeter 4.1 or later.

Syntax of inline functions:

[&Measure:Function(parameter, parameter, ...)]

Comma is used for separating inline function parameters. If your script or string have comma , draps them inside double quotes.

DynamicVariables = 1 MUST be set on any measures or meters where inline function is used.

Example usage:

[Psrm]
Measure = Plugin
Plugin = PowershellRM
Line = function Nuzzle($num) { return "Rawr x$($num)!" }
Line2 = $weedNumber = 420

[TextMeter]
Meter = String
Text = [&Psrm:Invoke(Nuzzle 3)]
W = [&Psrm:Variable(weedNumber)]
SolidColor = 000000
FontColor = FFFFFF
FontSize = 30
DynamicVariables = 1

Invoke

Syntax: [&Measure:Invoke(script)]

invokes script and last output object will be section variable value.

Variable

Syntax: [&Measure:Variable(variableName[, defaultValue])

Get a PowerShell variable value.

Optionally, you can set defaultValue to fallback to when runspace is not ready or variable is not available. Default defaultValue is blank string.

Expand

Syntax: [&Measure:Expand(input)]

Returns input string with all of the variable and expression substitutions done.

Example Expand usage
[&Weather:Expand(Today is $($condition)`nTemp: $($tempC * 9 / 5 + 32) F)]

Last updated