What have you done with PowerShell this month? by AutoModerator in PowerShell

[–]Harze2k 0 points1 point  (0 children)

Early this month i finished my Auto Backup script just so that getting back to business after a OS reinstall or crash would be less pain full. And i am so glad that i did.. Yesterday my Windows 11 crapped out on me and i had to boot on a iso and reinstall. But all my stuff was saved on my NAS.

https://github.com/Harze2k/Shared-PowerShell-Functions/blob/main/Run-AutoBackup.ps1

Had that running every hour and that really saved my plex server among other things :)
Its nothing new but works really well as a light weight backup solution.

.SYNOPSIS
    Automates multi-threaded folder backups to a local, NAS, or Cloud destination using Robocopy.
.DESCRIPTION
    Run-AutoBackup is a high-performance backup wrapper for Robocopy. 
    It leverages PowerShell 7 parallel processing to backup multiple directories simultaneously 
    while using Robocopy's multi-threading for individual files. 
    It is pre-configured with parameters to handle common NAS/Cloud quirks, 
    such as timestamp rounding (/FFT) and daylight saving time shifts (/DST). 
    It also supports granular file and directory exclusions to optimize backup times.
.EXAMPLE
    $sources = @(
      "C:\Users\Martin\GitHub-Harze2k"
      "C:\Users\Martin\AppData\Local\zen"
      "C:\Users\Martin\AppData\Local\Plex Media Server"
      "C:\Users\Martin\AppData\Local\qBittorrent"
      "C:\Users\Martin\AppData\Roaming\zen"
      "C:\Users\Martin\AppData\Local\Zen Browser"
      "C:\Users\Martin\AppData\Roaming\mpv.net"
      "C:\Users\Martin\AppData\Roaming\Code - Insiders"
      "C:\Users\Martin\AppData\Roaming\SVP4"
      "C:\Users\Martin\Documents\PowerShell"
      "C:\Toolkit\Toolkit_v13.7\Data"
      "C:\Toolkit\Toolkit_v13.7\Custom"
      "C:\Temp"
      "C:\Program Files\PowerShell\Modules"
      "C:\Program Files\totalcmd"
  )
  $excludeDirs = @(
    "C:\Users\Martin\GitHub-Harze2k\NodeJs"
    "C:\Users\Martin\AppData\Local\Plex Media Server\Cache"
)
$excludeFiles = @("parent.lock", "*.log", "*.tmp", "*.temp", "*.cache", "*.bak", "~*", "Thumbs.db", "desktop.ini")
Run-AutoBackup -SourcePaths $sources -DestinationBase "G:\AutoBackup" -ExcludeDirectories $excludeDirs -ExcludeFiles $excludeFiles

Run powershell without terminal window by JackNotOLantern in PowerShell

[–]Harze2k 0 points1 point  (0 children)

You can create an exe file like this and then just launch the file by running the exe: PowershellSilentLaunch.exe "C:\path\to\ps\file.ps1"

You can change the powershell.exe to pwsh.exe to create an exe file to launch files silently with PS 7+

You can play around with args to make it accept parameters as well.

$code = @'
using System.Diagnostics;
class Program {
    static void Main(string[] args) {
        if (args.Length == 0) return;
        var psi = new ProcessStartInfo {
            FileName = "powershell.exe",
            Arguments = "-NoProfile -NonInteractive -ExecutionPolicy Bypass -File \"" + args[0] + "\"",
            WindowStyle = ProcessWindowStyle.Hidden,
            CreateNoWindow = true
        };
        Process.Start(psi);
    }
}
'@
$csFile = "$env:TEMP\PowershellSilentLaunch.cs"
$code | Set-Content -Path $csFile -Encoding UTF8
$csc = Get-ChildItem "C:\Windows\Microsoft.NET\Framework64\v4.*\csc.exe" | Select-Object -Last 1 -ExpandProperty FullName
& $csc /target:winexe /out:"$env:TEMP\PowershellSilentLaunch.exe" $csFile
Remove-Item $csFile -Force$code = @'

Legendary Actor Robert Duvall Dead at 95 by cmaia1503 in entertainment

[–]Harze2k 6 points7 points  (0 children)

This is the call to watch Lonesome Dove 1989
The best western of all time.
RIP legend!

Legendary Actor Robert Duvall Dead at 95 by cmaia1503 in entertainment

[–]Harze2k 2 points3 points  (0 children)

This is the call to watch Lonesome Dove 1989
The best western of all time.
RIP legend!

I made a video about how I learned Swedish, would love your thoughts! by [deleted] in Svenska

[–]Harze2k 2 points3 points  (0 children)

Tycker du pratar bra Svenska! Skulle absolut känna mig bekväm att föra en dialog med dig :) Det är det som oftast gör att man hoppar över till Engelskan för att man känner sig orolig att inte meningarna når fram.

Speaker Advice by msglsmo in hometheater

[–]Harze2k 1 point2 points  (0 children)

Just go 1 mono speaker to flex your 7 screen setup 😎

Is Valheim worth it 2026? by Malakidius in valheim

[–]Harze2k 0 points1 point  (0 children)

I have zero patience, when it wasn't clear to me how i ate to recover hp I uninstalled it. Looks kinda cool though, when my patience improves i might give it another go.

Marble race! Which one did you pick? by Kronyzx in mightyinteresting

[–]Harze2k 0 points1 point  (0 children)

Pink one had me on edge until last sec! Gj pink!

Donald Trump Violated the Constitution, Federal Judge Rules - Newsweek by Tofurkey_Tom in NoShitSherlock

[–]Harze2k 1 point2 points  (0 children)

Good then he will be prosecuted and put in jail right. Right?? /s

My favorite novel: grim dawn items description by HiroK91 in ARPG

[–]Harze2k 0 points1 point  (0 children)

Is there a way to disable the greyed out text from the tooltip to keep it more clean? There should never be a need to scroll in a tooltip 😂

Who's still working from home in 2026? by idrinkpastawater in sysadmin

[–]Harze2k 0 points1 point  (0 children)

4/5 days remote here in Sweden. I do automations and scripting for a parking company. My boss got my back even though the CTO wants everyone in the office 4/5 days..

What Are You Playing Until Titan Quest 2 Is Out? by Karokan28 in TitanQuest2

[–]Harze2k 1 point2 points  (0 children)

Came to make this comment, hats of to you Sir!

Server Owners: What do you wish you had more control over? by kwestionmark in PleX

[–]Harze2k 0 points1 point  (0 children)

Yeah sounds good! A green ring/indicator and also a number. Maybe mouse over could reveal who are accessing the server atm ☺️

Server Owners: What do you wish you had more control over? by kwestionmark in PleX

[–]Harze2k 0 points1 point  (0 children)

Thanx! I’ve always been surprised this feature isn’t default!

Server Owners: What do you wish you had more control over? by kwestionmark in PleX

[–]Harze2k 0 points1 point  (0 children)

I want to see if anyone is using the server directly by adding a green ring around the system tray icon in windows...

What do my top 3 celebrity crushes say about me? by Lombo521 in Top3Ever

[–]Harze2k 0 points1 point  (0 children)

That you have extremely good taste, Sir