Invoke-Command {Set-ItemProperty} not working

I’m easily able to use Set-ItemProperty to set the value of a registry entry when in a session to a remote host.

However, when I try to wrap it in Invoke-Command to run it from my machine it fails. I haven’t found out why yet. Anyone got ideas?

I’m doing it something like (this is from memory so maybe not 100% accurate):
Invoke-Command -Host hostname -Command {Set-ItemProperty -Path “HKCU:SoftwareSomethingWhatsit” -Name $name -Value $value}

submitted by /u/PeterPanLives
[link] [comments]

Leave a Reply