This file contains hidden or 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
| function Ask-NonEmpty([string]$prompt) { | |
| while ($true) { | |
| $v = Read-Host $prompt | |
| if ($v -and $v.Trim().Length -gt 0) { return $v.Trim() } | |
| Write-Host "Input cannot be empty. Please try again." -ForegroundColor Yellow | |
| } | |
| } | |
| function Pause-ForUser { | |
| Write-Host "" |
This file contains hidden or 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
| Add-Type -AssemblyName System.Drawing | |
| Write-Host "" | |
| # Ask user for image path (Read-Host adds ":" automatically, so do NOT include one) | |
| $path = Read-Host "Paste the full path to your image" | |
| # Trim quotes if user pasted them | |
| $path = $path.Trim().Trim('"') |
This file contains hidden or 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
| # Close Sticky Notes so DB isn't locked | |
| taskkill /IM Microsoft.Notes.exe /F 2>$null | Out-Null | |
| # --- Paths --- | |
| $plum = "$env:LOCALAPPDATA\Packages\Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe\LocalState\plum.sqlite" | |
| if (!(Test-Path $plum)) { throw "Couldn't find plum.sqlite at: $plum" } | |
| # Output folder (loop until valid) | |
| do { | |
| $vault = Read-Host "Paste a path where you want the folder with the exports to be created" |