How to skip file download with powershell if file exists

Question:

I have the following script which downloads some files from channel 9:

I need to improve it to skip the download if the file already exists.

Answer:

You have to pass the whole path to the Test-Path cmdlet to check whether the file exist. Then all you have to do is to return the function:

Source:

How to skip file download with powershell if file exists by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply