> For the complete documentation index, see [llms.txt](https://khanhas.gitbook.io/powershellrm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://khanhas.gitbook.io/powershellrm/inline-functions.md).

# Inline Functions

Functions to be used in measure section variable.

**Requirement:** Rainmeter 4.1 or later.

**Syntax of inline functions:**

{% code title="" %}

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

{% endcode %}

{% hint style="info" %}
Comma is used for separating inline function parameters. If your script or string have comma , draps them inside double quotes.
{% endhint %}

&#x20;`DynamicVariables = 1` MUST be set on any measures or meters where inline function is used.

**Example usage:**

{% code title="" %}

```php
[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
```

{% endcode %}

![](https://1271679907-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LWurn9GlyCSIm6u-0Mt%2F-LWz9R73m6jAGuMFhxk2%2F-LWzkAcVHIlwvp30hZR2%2Fimage.png?alt=media\&token=12cd7d66-5169-4101-9dab-2ac065b40eac)

## `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.&#x20;

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.

{% code title="Example Expand usage" %}

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

{% endcode %}
