Hi everyone.
I am trying to get more familiar with WINSCP / powershell file handling, and i am quite the rookie so my questions here might be beginner ones.
I am attempting to download files from a shared hosting server, but i only want to target a specific file.
In this case i was to download this file from all domains on the server:
domainname/wp-config.php
This have succeeded somewhat, but i am struggling with modifying my script to use a list of filepaths.
I want to make the list like this:
domainname1.dk/wp-config.php
domainname2.dk/wp-config-php - and so on.
( in some cases i might want to get other php files too )
My script tells me:
Error: Exception calling “Check” with “0” argument(s): “Can’t get attributes of file ‘C:\Users\Dern\Desktop\Searchtarget\searchtargetlist.txt’.
Could not retrieve file information
‘/C:\Users\Dern\Desktop\Searchtarget\searchtargetlist.txt’ cannot be listed”
And i really cant seem to figure out why…
Link to my script:
https://gist.github.com/Jonatantwn/39c3ff9178c6711856da6cbdd26ca642
I bet some of you more experienced scripters can point out my mistake…
Please help!
Best regards
Jonatan