행위

"PowerShell 일괄 파일 다운로드 스크립트"의 두 판 사이의 차이

라이언의 꿀팁백과

(새 문서: # Define the range of ID numbers $startNumber = 1 $endNumber = 1112 # Loop through the range of ID numbers for ($id = $startNumber; $id -le $endNumber; $id++) { # Format the ID number to have leading zeros $formattedId = $id.ToString("D5") $url = "https://www.example.com?filePath=" + $formattedId $outputName = $formattedId + ".jpg_" # Execute the external command with the formatted ID as a parameter Invoke-WebRequest -Uri $url -OutFile $outputName })
(차이 없음)

2024년 1월 26일 (금) 14:28 판

  1. Define the range of ID numbers

$startNumber = 1 $endNumber = 1112

  1. Loop through the range of ID numbers

for ($id = $startNumber; $id -le $endNumber; $id++) {

   # Format the ID number to have leading zeros
   $formattedId = $id.ToString("D5")
   $url = "https://www.example.com?filePath=" + $formattedId
   $outputName = $formattedId + ".jpg_"
   # Execute the external command with the formatted ID as a parameter
   Invoke-WebRequest -Uri $url -OutFile $outputName

}