Snippets

Ettar Powershell Picture Download

Created by Ettar last modified Ettar
Import-Module BitsTransfer

#Textdatei mit dem Namen ImageList.txt im selben Ordner erstellen. Darin die Links erfassen
$ImageList = Get-Content ".\ImageList.txt"

foreach ($IPath in $ImageList) {

    $SplitURL = $IPath.Split("/")
    #Bei Dest Ordnerpfad angeben, in dem die Bilder gespeichert werden sollen
    $Dest = "Imagepath"
    $Cont = Get-ChildItem -Path $Dest
    $exit = 0
    $Name = ""

    foreach ($Obj in $SplitURL) {
        if ($Obj -like "*.jpg" -or $Obj -like "*.jpeg" -or $Obj -like "*.png") {
            $Name = $Obj
        }
    }

    foreach ($File in $Cont) {
        if ($File.Name -eq $Name) {
            $exit = -1
        }
    }

    if ($exit -eq 0 -or $Name -eq "") {
        Start-BitsTransfer $IPath $Dest -TransferType Download -DisplayName "Download Pic"
    }

}

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.