this post was submitted on 09 Jun 2023
8 points (100.0% liked)

PowerShell

311 readers
1 users here now

A community dedicated to Microsoft PowerShell.

Rules

  1. Everyone is welcome.
  2. Treat others with respect at all time.
  3. When asking questions, please try to show what you have done, including code.

founded 2 years ago
MODERATORS
 

As a way to kick off migration from Reddit to Lemmy, let's start with a classic thread. So, what have you done with PowerShell this month?

For bonus imaginary points, have you done anything in regards to the Great Reddit Migration?

you are viewing a single comment's thread
view the rest of the comments
[–] emptyother 2 points 2 years ago

Wrote a C# powershell module with two commands, one for retrieving tags/keyword metadata from passed in imagefiles, and one for creating windows shortcuts from passed files.

Import-Module .\PSGetTagMetadata.dll
# Find all jpg and png images with just one tag, and create a shortcut to them.
$myfiles = gci -Path "C:\users\username\Pictures\" -Recurse -Include "*.jpg","*.png" | Get-TagMetadata | ? { $_.Keywords.Count -eq 1 }
$myfiles | % { $_.File } | Set-Shortcut

It can still be improved upon, of course, but for the moment it did what I needed.