I'm trying to get better "readability" with my script by declaring variables then passing those to the command, but I'm running into a snag. I think I know why, but I thought I'd check with the community at large.
With the above code, I get an error "Cannot bind argument to parameter 'Path' because it is null." If I take out $RegKey1 and $RegKey2 and type out the values I've declared above, the script works fine. Is this because the $RegKey1 and $RegKey2 are trying to resolve on the remote computer where they haven't been declared?