I have the next code, but when i use the arguments, it doesn't work like I try to find all the txt files in one drive:
Invoke-Command -ComputerName $param3 -Credential $cred -ArgumentList $param4,$param5,$param6,$param7 -ScriptBlock {$A = Get-ChildItem $args[0] -Recurse | Where-Object {$_.name -match ".*$args[1].*"} | Format-Table Name, CreationTime, Length, FullName -auto***'
*The variable $param5 has the text ".txt"
-matchperforms substring matching by default, you needn't surround a search term with.*, so you could just use$args[1]by itself, but the only real problem with your answer is the direct use of$args[1]inside"..."- as an expression, it must be enclosed in$(...)-".*$($args[1]).*"- as explained in the linked post.