From 1ed1bb7ef66eb594a5b0927a37cff99394ac232e Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 28 Nov 2024 15:17:33 +0100 Subject: [PATCH] compat: fix compatibility with PowerShell 5 --- util/windows.psm1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/windows.psm1 b/util/windows.psm1 index 7d6299a..ddf8378 100644 --- a/util/windows.psm1 +++ b/util/windows.psm1 @@ -179,7 +179,9 @@ function InstallNerdFont ) $fileName = [System.IO.Path]::GetFileNameWithoutExtension($source) - $parent = $source -split '\\' | Select-Object -SkipLast 1 | Join-String -Separator '\' + $parent = Get-ChildItem $source | ` + Select-Object -ExpandProperty Parent | ` + Select-Object -ExpandProperty FullName $destination = "$parent\$fileName" # Create destination directory