Open utterances-bot opened 1 year ago
Interesting, Do You Think That It's Possible Also To Have The -Theme 'Indiana Jones' Name As A Variable And Traverse All Themes To Have PDF Downloaded On Separate Folders For Theme?
For sure. You could do something like this:
$themes = 'Indiana Jones','Harry Potter'
foreach ($theme in $themes){
if (! (Test-Path $theme)){
$null = New-Item -Path $theme -ItemType Directory
}
Get-BricksetSet -Theme $theme | Get-BricksetSetInstructions | Select-Object -First 2 | Select-Object -ExpandProperty url | ForEach-Object {$file = ($_.split('/'))[-1]; Start-BitsTransfer -Source $_ -Destination "C:\Test\$theme\$file"}
}
Thanks For The Tips... This Worked For A While But Now I Get This Error:
$instructionsUrls = $_ | Get-BricksetSetInstructions | Select …
The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the
parameters that take pipeline input.
Ok All Fine I've Discovered That API Key Is Blocked If You Download Tons Of PDF In A Short Period Of Time So I've Added A Random Delay To The Script
PowerShell Brickset Module – Part 2: Downloading Instructions - Jonathan Medd's Blog
https://www.jonathanmedd.net/2016/12/powershell-brickset-module-part-2-downloading-instructions.html