Supply values for the following parameters

I have actually this manuscript copying initially month backup file from directory to another.This works fine however needs user treatment and not execute immediately. How i can silent this message ?


Here is the code:

$bak_route = "C:UsersadminPictures est"$backup_dest = "C:UsersadminPicturespaste"get-childitem -path $bak_route -Filter "*" | where-object -not $_.PSIsContainer | sort-object -Property $_.CreationTime | select-object -last 1 | copy-item -Desticountry (join-course $backup_dest )



Your trouble is join-path. You should supply a path and a child course. So by doing that you would certainly eliminate the prompt. It"s unclear why that join-route is there in the initially place. It"s most likely that you can just leave it out.

You watching: Supply values for the following parameters


This message comes from join-path, because join-route requirements a -Path and a -ChildPath to occupational.

See more: Bsod Kmode_Exception_Not_Handled Ndis.Sys, How To Fix Kmode Exception Not Handled Error

so your command need to look like this join-course -course $backup_dest -childroute xy

however in my opinion, you do not need join-path at all.

why not just copy-item -Desticountry $backup_dest?

which courses do you desire to join?


Thanks for contributing a response to Super User!

Please be certain to answer the question. Provide details and share your research!

But avoid

Asking for aid, clarification, or responding to various other answers.Making statements based upon opinion; back them up via recommendations or individual endure.

See more: The Language Or Edition Of The Version Of Windows Currently Installed

To learn even more, check out our tips on writing great answers.

Message Your Answer Discard

By clicking “Message Your Answer”, you agree to our regards to business, privacy policy and also cookie plan

Not the answer you're looking for? Browse various other concerns tagged windows powershell script or ask your very own question.

Need help writing a Powershell script to automate a silent install of Avamar Client on multiple devices