Hi Paul,
I'm still not sure I understand where these commands are being executed. To me, they seem to be executing on the target local machine, because it is able to successfully "SET" the username, however, it can't seem to read the currently logged in user.
I also tested this, but the result is, it simply sets the Pulseway name to the Hostname ...
$key = 'HKCU:\Volatile Environment'
$UserName = (Get-ItemProperty -Path $key -Name USERNAME).USERNAME
Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\" -Name ComputerName -Value "$UserName"
Again, this works from the local workstation, but not as a script.
Is there a way to debug the scripts in Pulseway, and get output directly in Pulseway, as opposed to just plugging in the script and running it to see results?