0

when i call function in a script , i get error. can someone please help?

check_mul_f_mul_d : The term 'check_mul_f_mul_d' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At I:\Temp\IPCFileCheckNew\Script\getfilename.ps1:58 char:10 + check_mul_f_mul_d -START_DATE $START_DATE -END_DATE $END_DA ... + ~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (check_mul_f_mul_d:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

Code:

if ($FILENAME -eq "ALL") {
        Write-Output "Check all files of yesterday..." 
         WRITE-HOST $TempBadoutfile  $Tempokoutfile $CNT_FILE
         check_mul_f_mul_d -START_DATE $START_DATE  -END_DATE $END_DATE -ALLFILE_ARRAY $ALLFILE_ARRAY -CNT_FILE $CNT_FILE 
         -REPORTPATH $REPORTPATH -TempBadoutfile $TempBadoutfile -TempOKoutfile $Tempokoutfile}
else{........}




function check_mul_f_mul_d {

param ([String]$START_DATE, 
[String]$END_DATE,
[String]$FILENAME,
[String]$HSTCHECK,
[int]$CNT_DATE,
[int]$CNT_FILE,
[String[]]$ALLFILE_ARRAY,
[string]$REPORTPATH,
[STRING]$TempBadoutfile,
[STRING]$TempOKoutfile
)
write-host $ALLFILE_ARRAY $CNT_FILE

write-host $start_date $end_date
WRITE-HOST $TempOKoutfile $TEMPBADOUTFILE

........

}

1 Answer 1

1

You should put the function definition before the function call

Sign up to request clarification or add additional context in comments.

1 Comment

you are wellcome :))

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.