Powershell Functions with multiple params -


i attempting write function compress files using 7zip, having issues passing multiple parameters function.

$in = "c:\test\gateways_25357_20140407000204.pcap" $out = "c:\test\gateways_25357_20140407000204.zip"   function compressfile([string]$output,[string]$input) {     write-host $output     write-host $input     $7zippath = "c:\program files\7-zip\7z.exe"     $arguments = "a","-tzip",$output,$input     & $7zippath $arguments  }  compressfile $out $in 

my results of code compressing of files in working directory of script , output goes correct location c:\test.

what doing wrong here passing in $input parameter?

$input powershell automatic variable, try changing name. see

$in = "c:\test\gateways_25357_20140407000204.pcap" $out = "c:\test\gateways_25357_20140407000204.zip"   function compressfile([string]$outputz, [string]$inputz) {     write-host $outputz     write-host $inputz } write-host $out write-host $in compressfile $out $in 

http://technet.microsoft.com/en-us/library/hh847768.aspx


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -