Hi,
I would like to create a function with dos command(xcopy) and to create for this DOS command paramaters in variables (
original dos command with paramters: "xcopy C:\Temp\Force2.csv C:\ssm /S /E >>c:\Temp\xcopylog.txt"
) something like this:
function copyonefile {
$source = "C:\Temp\Force2.csv"
$destination = "C:\ssm"
$options = "/S /E"
$log = ">>c:\Temp\xcopylog.txt"
$argarray = @("$source","$destination","$options","$log")
C:\Windows\System32\xcopy.exe $argarray }
Unfortunately, it's not working, can you advise?