I have a command that i have build and stored in a variable in power shell. This command works if i do a write-host and copy and past into a standard cmd.exe window.
How do i execute this command from inside my script?
I have tried several combination of invoke-command or invoke-expression with no luck.
This is how i built the variable:
$cmd1= $arcprg + $arcdir + "\" + $site1+"-"+$hst+"-"+$yesterday+".zip "+$logpath1+"u_ex"+$yesterday+".log"
This is what the variable looks like if it is printed to the screen:
7z.exe a -tzip c:\arc_logs\site-host-at-web1-100827.zip c:\inetpub\logs\logfiles\w3svc1\u_ex100827.log