Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Inserting Variables into Remote Script Code

$
0
0

Hi,
I'm trying to manipulate script code using variables before invoking it on remote machines. Unfortunately this doesn't work using string manipulation because it is not a string.

$PathVariable = "C:\test"
$RemotCode = {get-childitem -path $PathVariable}

Any ideas how to make this happen? It would shorten my code by 20%

Regards
Michael


Viewing all articles
Browse latest Browse all 6937

Trending Articles