I'm new with PowerShell and i've got a problem I cant deal with. I have to make my function analyze a lot of folders in a row, but my programm wont work when I give parameters to my function...
Param(
[string]$fPath
)
analyse $fPath
$importList = get-content -Path C:\Users\lamaison-e\Documents\multimediaList.txt
$multimediaList = $importList.Split(',')
function analyse{
Param(
[parameter(Mandatory=$true)]
[String]
$newPath
)
cd $newPath
$Resultat = "Dans le dossier " + $(get-location) + ", il y a " + $(mmInCurrentDir) + " fichier(s) multimedia pour un total de " + $(multimediaSize) + " et il y a " + $(bInCurrentDir) + " documents de bureautique pour un total de " + $(bureautiqueSize) + ". La derniere modification du dossier concerne le fichier " + $(modifDate)
$Resultat
}
It worked when 'analyse' didnt exist but stopped working just after that. CommandNoFoundException. It may be a stupid mistake but i cant deal with it... Thank you for your time.
functionis not a declaration, it is a command, that have to be executed to create/modify function.