I'm using Powershell(V4) and I'm following the code give here,however, it gives me an error when I run the code.
My Code:
[string]$zipPath="C:\Users\someUser\7z.exe"
[string]$parameters= 'a', '-tzip','C:\Users\someUser\Desktop\Archive.zip','C:\Users\someUser\Desktop\Test'
Powershell View:
PS C:\Users\someUser> $zipPath="C:\Users\someUser\7z.exe" $parameters= 'a', '-tzip','C:\Users\someUser\Desktop\Archive.zip','C:\Users\someUser\Desktop\Test' & $zipPath $parameters
& $zipPath $parameters
Output:
7-Zip (A) 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
Error:
Incorrect command line