echo off
rem
rem persistVariable demo script
rem
rem    arg 1 is operation, read, update, verify, delete
rem    arg 2 is NAME, or NAME=VALUE

persistVariable update cmdName=5
if errorlevel 1 (
    echo "persistVariable failed save cmdName"
    addLogRecord %0 ERROR "persistVariable failed save cmdName"
) else (
    persistVariable verify cmdName=5
    if errorlevel 1 (
        echo "persist cmdName variable failed to verify"
        addLogRecord %0 ERROR "cmdName failed to verify"
    ) else (
        persistVariable read cmdName
        echo "persistVariable of variable 'cmdName' succeeded with value %errorlevel%"
        addLogRecord %0 INFO "persistVariable of variable 'cmdName' succeeded with value %errorlevel%"
        )
    )
    rem cleanup demo variable
    persistVariable delete cmdName
)
