Get and set-PSUvariable woes

I’m trying to get and/or set a variable with a script, but I’m not having much luck.

the cmdlet docs arent really updated ( universal-docs/Get-PSUVariable.txt at master · ironmansoftware/universal-docs · GitHub), and the docs doesnt mention the cmdlets

I’ve got a simple Variable “VarTest” and in my script (integrated environment) this line:

Get-PSUVariable -Name VarTest -Integrated -UseDefaultCredentials

the script returns " [error] Failed to query.NotFound "

Product: PowerShell Universal
Version: 2.8.1

oh, maybe this is related to Variables are not working in the Integrated environment · Issue #646 · ironmansoftware/issues (github.com)

I think you might need to try not using Integrated mode.

Connect-PSUServer -ComputerName http://localhost
Set-PSUVariable -Name VarTest -Value Cool -UseDefaultCredentials
Get-PSUVariable -Name VarTest -UseDefaultCredentials

hmm, not having much luck
Feb 17, 2022 7:57 PM [error] Response could not be deserialized to JSON: GET https://beta.middlewaredashboard.d007.org/api/v1/Variable/VarTest

Got around it by dumping the data with Export-CMLIXML to a file. But it would be nice to use variables instead.

Hello, looking for a bit of a pointer.

These commands FAIL when run at a normal PowerShell ISE on the server hosting PSU.
Any suggestions would be greatly appreciated. Ultimately I am trying to figure out a way to get the name of a FAILED Script into the Trigger Script and corresponding email/problem ticket.

Thanks

Cris