Skip to content

Commit 8338956

Browse files
Use -LiteralPath consistently in Install-TukuiAddon; add PS 5.1 install instructions to README
- Switch Get-ChildItem and Copy-Item in extraction section to -LiteralPath for consistency with the function's path safety checks (review thread #13) - Use -LiteralPath and -ErrorAction SilentlyContinue in finally cleanup to prevent masking original errors (review thread #14) - Add Windows PowerShell 5.1 Install-Module alternative alongside Install-PSResource in README (review thread #15)
1 parent 5057fe6 commit 8338956

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ for [World of Warcraft](https://worldofwarcraft.blizzard.com/).
1414
To install the module from the PowerShell Gallery:
1515

1616
```powershell
17+
# PowerShell 7.4+ (Install-PSResource is built-in)
1718
Install-PSResource -Name ElvUI
1819
Import-Module -Name ElvUI
20+
21+
# Windows PowerShell 5.1 (use Install-Module instead)
22+
Install-Module -Name ElvUI -Scope CurrentUser
23+
Import-Module -Name ElvUI
1924
```
2025

2126
## Usage

src/functions/private/Install-TukuiAddon.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@
6464
}
6565

6666
# Copy new folders
67-
$extractedFolders = Get-ChildItem -Path $extractPath -Directory -ErrorAction Stop
67+
$extractedFolders = Get-ChildItem -LiteralPath $extractPath -Directory -ErrorAction Stop
6868
foreach ($folder in $extractedFolders) {
6969
$destination = Join-Path -Path $AddOnsPath -ChildPath $folder.Name
7070
Write-Verbose " Installing $($folder.Name)"
71-
Copy-Item -Path $folder.FullName -Destination $destination -Recurse -Force -ErrorAction Stop
71+
Copy-Item -LiteralPath $folder.FullName -Destination $destination -Recurse -Force -ErrorAction Stop
7272
}
7373

7474
Write-Verbose "$($Addon.Name) $($Addon.Version) installed successfully!"
7575
} finally {
76-
if (Test-Path $tempDir) {
77-
Remove-Item $tempDir -Recurse -Force
76+
if (Test-Path -LiteralPath $tempDir) {
77+
Remove-Item -LiteralPath $tempDir -Recurse -Force -ErrorAction SilentlyContinue
7878
}
7979
}
8080
}

0 commit comments

Comments
 (0)