Skip to main content

4 posts tagged with "Powershell"

View All Tags

How to mirror GDrive to local

· One min read

How to mirror data from GDrive to local

I tend to push larger repositories to GDrive as Github cannot easily host files above 100 MB. How would you mirror a GDrive folder and subfolders to your local drive and have an easy script to update these?

Below you find a Powershell script for Windows utilizing gdown!

Unreal Plugin Compile

· 2 min read

Tiny roboter on a piece of paper

Powershell script to recompile a plugin

This script will start the RunUAT.bat file filled with parameters to compile the plugin. Copy into a *.ps1 file, modify the parameter '$pathToEngine' and run in the director of the plugin.

You will need a working Visual Studio Installation to have the make file in your path.

ImageMagick Resize

· One min read

Resize Images with Image Magick

A small script to resize your images with ImageMagick and Powershell using multi threading. Easiest to install Imae Magick is using

Install ImageMagick with winget
winget install imagemagick

Make sure that the Image Magick folder is in your path.

The Powershell script has two parameters:

  • resizePercentage: How large should the resulting pictures be compared to the original?
  • suffix: This will be added to the image name

The script is using '*.jpg' as a filter - adjust if needed:

Resize images with ImageMagick
# Set variables
$resizePercentage = 50
$suffix = "_50"

$scriptBlock = {
param($fileName, $newFileName, $resizePercentage)
magick $fileName -resize $resizePercentage% $newFileName
}

# Get all .jpg files and start jobs
$jobs = @()
Get-ChildItem -Path . -Filter *.jpg | ForEach-Object {
$newFileName = $_.BaseName + $suffix + ".jpg"
$job = Start-Job -ScriptBlock $scriptBlock -ArgumentList $_.Name, $newFileName, $resizePercentage
$jobs += $job
Write-Host "Started conversion job for $($_.Name)" -ForegroundColor Cyan
}

# Wait for all jobs to complete
$jobs | Wait-Job