This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd "C:\path\to\media" | |
# Rename Media based on the 'CreationTime' | |
Get-ChildItem *.jpg -Recurse | Rename-Item -newname {$_.CreationTime.toString("yyyyMMdd_HHmmss") + $_.Extension} -ErrorAction SilentlyContinue | |
Get-ChildItem *.jpeg -Recurse | Rename-Item -newname {$_.CreationTime.toString("yyyyMMdd_HHmmss") + $_.Extension} -ErrorAction SilentlyContinue | |
Get-ChildItem *.png -Recurse | Rename-Item -newname {$_.CreationTime.toString("yyyyMMdd_HHmmss") + $_.Extension} -ErrorAction SilentlyContinue | |
Get-ChildItem *.mp4 -Recurse | Rename-Item -newname {$_.CreationTime.toString("yyyyMMdd_HHmmss") + $_.Extension} -ErrorAction SilentlyContinue | |
Get-ChildItem *.jpg, *.jpeg, *.png, *.mp4 -Recurse -ErrorAction SilentlyContinue | ForEach-Object -process { | |
# Set Output Folder Based on File Type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Text.RegularExpressions; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json.Linq; | |
namespace NuGetDownloader | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$indexClient = new-object system.net.webclient | |
$jsonIndex=$indexClient.DownloadString("https://api.nuget.org/v3/catalog0/index.json") | ConvertFrom-Json | |
for ($h=0; $h -lt $jsonIndex.items.Length; $h++) { | |
$web_client = new-object system.net.webclient | |
$jsonObj=$web_client.DownloadString($jsonIndex.items[$h].'@id') | ConvertFrom-Json | |
for ($i=0; $i -lt $jsonObj.items.Length; $i++) { | |
$package = $jsonObj.items[$i]."nuget:id" + "/" + $jsonObj.items[$i]."nuget:version" | |
$web_client.DownloadFile("https://www.nuget.org/api/v2/package/" + $package, ("C:\Nuget\" + $jsonObj.items[$i]."nuget:id" + "." + $jsonObj.items[$i]."nuget:version" + ".nupkg")) | |
"Processing: " + ($h + 1) + " of " + $jsonIndex.count + " ---- " + ($i + 1) + " of " + $jsonObj.count + " - " + $jsonObj.items[$i]."nuget:id" + "." + $jsonObj.items[$i]."nuget:version" | |
} |