import-csv C:\CSVFILE.csv | % { Invoke-Command -ComputerName $($_.COMPUTERNAME) -ScriptBlock { copy "\\server\share\regFile.reg" $env:temp ; reg.exe import $env:temp\regFile.reg }
Copy "\\server\share\regFile.reg" $env:temp ; //copy the regfIle in the shared \\server\share to the "temporal value" on C:\windows\temp
reg.exe import $env:temp\regFile.reg //this will run the import to add the registry file (now in C:\windows\temp\regFile.reg)
into that particular computer.
reg /?
REG Operation [Parameter List]
Operation [ QUERY | ADD | DELETE | COPY |
SAVE | LOAD | UNLOAD | RESTORE |
COMPARE | EXPORT | IMPORT | FLAGS ]
Return Code: (Except for REG COMPARE)
0 - Successful
1 - Failed
For help on a specific operation type:
REG Operation /?
Examples:
REG QUERY /?
REG ADD /?
REG DELETE /?
REG COPY /?
REG SAVE /?
REG RESTORE /?
REG LOAD /?
REG UNLOAD /?
REG COMPARE /?
REG EXPORT /?
REG IMPORT /?
REG FLAGS /?
REG IMPORT AppBkUp.reg
$env:temp reads the environmental variables for the name temp and uses the value
Open in new window