← script library

Read Data from a Previous Runbook Step in PowerShell

ServerEngine PlatformAugust 17, 2026

The receiving end of the same mechanism, including the case that comes up most: splitting a comma separated list back into an array of user names or service names to loop over. Read it together with the save script — they are two halves of one idea.

powershell
# To access and load stored data from the script before
# use the $store variable like this:
#--------------------------------------------------
function Write-Log {
    param($Message)
    Write-Host "<WRITE-LOG = `"*$Message*`">"
}

# Example 1 (Load Text)
$example1 = $store

# Example 2 (Load Variable)
$example2 = $store

# Example 3 (Load Numeric Values)
$example3 = $store

# Example 4 (Load String List)

$userList = @()
$userList = $store -split ","
Write-Log $userList

#--------------------------------------------------
# Only use one example at a time
#--------------------------------------------------

Run it across your fleet

This script runs as-is on a single host. Paste it into ServerEngine to schedule it, run it on a whole server group in parallel, and keep the credentials out of the file — see the scripts documentation and the credential store.

Ready when you are.

Try ServerEngine free for 7 days.