$base = "https://raw.githubusercontent.com/RT-Thread/rtthread-nano/master/rt-thread" $root = "d:\20_AI\LSPi\libs\thirdparty\rt-thread" $files = @( @("include/rtthread.h", "include/rtthread.h"), @("include/rtdef.h", "include/rtdef.h"), @("include/rthw.h", "include/rthw.h"), @("include/rtservice.h", "include/rtservice.h"), @("include/rtm.h", "include/rtm.h"), @("include/rtdebug.h", "include/rtdebug.h"), @("include/rtdbg.h", "include/rtdbg.h"), @("src/clock.c", "src/clock.c"), @("src/components.c", "src/components.c"), @("src/cpu.c", "src/cpu.c"), @("src/device.c", "src/device.c"), @("src/idle.c", "src/idle.c"), @("src/ipc.c", "src/ipc.c"), @("src/irq.c", "src/irq.c"), @("src/kservice.c", "src/kservice.c"), @("src/mem.c", "src/mem.c"), @("src/memheap.c", "src/memheap.c"), @("src/mempool.c", "src/mempool.c"), @("src/object.c", "src/object.c"), @("src/scheduler.c", "src/scheduler.c"), @("src/signal.c", "src/signal.c"), @("src/slab.c", "src/slab.c"), @("src/thread.c", "src/thread.c"), @("src/timer.c", "src/timer.c"), @("libcpu/arm/cortex-m4/cpuport.c", "libcpu/arm/cortex-m4/cpuport.c"), @("libcpu/arm/cortex-m4/context_gcc.S", "libcpu/arm/cortex-m4/context_gcc.S") ) foreach ($f in $files) { $url = "$base/$($f[0])" $out = "$root/$($f[1])" Write-Host "Downloading $($f[1]) ..." Invoke-WebRequest -Uri $url -OutFile $out -UseBasicParsing } Write-Host "All files downloaded!"