From a6bc75edbf5fed7aa4606b4c6f656f05eceef231 Mon Sep 17 00:00:00 2001 From: helpimnotdrowning <35247379+helpimnotdrowning@users.noreply.github.com> Date: Mon, 22 May 2023 13:48:41 -0500 Subject: [PATCH] Fix custom image breaking when special characters are present in path Fix the custom image breaking when special characters (square brackets, others) are present in the `$image` path in the config file --- winfetch.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winfetch.ps1 b/winfetch.ps1 index 2fbe9ed..317ae46 100644 --- a/winfetch.ps1 +++ b/winfetch.ps1 @@ -368,8 +368,8 @@ $img = if (-not $noimage) { } Add-Type -AssemblyName 'System.Drawing' - $OldImage = if (Test-Path $image -PathType Leaf) { - [Drawing.Bitmap]::FromFile((Resolve-Path $image)) + $OldImage = if (Test-Path -LiteralPath $image -PathType Leaf) { + [Drawing.Bitmap]::FromFile((Resolve-Path -LiteralPath $image)) } else { [Drawing.Bitmap]::FromStream((Invoke-WebRequest $image -UseBasicParsing).RawContentStream) }