mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 14:45:52 -06:00
Simplify WinUtil Directory Creation in 'main.ps1' script by using C# 'CreateDirectory' Method which checks and creates the provided Directory Path (#2654)
This commit is contained in:
parent
6ad31edef1
commit
1bfd8bddcc
@ -450,9 +450,7 @@ $winutildir = @{}
|
|||||||
|
|
||||||
# Set the path for the winutil directory
|
# Set the path for the winutil directory
|
||||||
$winutildir["path"] = "$env:LOCALAPPDATA\winutil\"
|
$winutildir["path"] = "$env:LOCALAPPDATA\winutil\"
|
||||||
if (-NOT (Test-Path -Path $winutildir["path"])) {
|
[System.IO.Directory]::CreateDirectory("$winutildir") | Out-Null
|
||||||
New-Item -Path $winutildir["path"] -ItemType Directory
|
|
||||||
}
|
|
||||||
|
|
||||||
# Set the path for the logo and checkmark images
|
# Set the path for the logo and checkmark images
|
||||||
$winutildir["logo.png"] = $winutildir["path"] + "cttlogo.png"
|
$winutildir["logo.png"] = $winutildir["path"] + "cttlogo.png"
|
||||||
@ -460,7 +458,6 @@ $winutildir["logo.ico"] = $winutildir["path"] + "cttlogo.ico"
|
|||||||
if (-NOT (Test-Path -Path $winutildir["logo.png"])) {
|
if (-NOT (Test-Path -Path $winutildir["logo.png"])) {
|
||||||
Invoke-WebRequest -Uri "https://christitus.com/images/logo-full.png" -OutFile $winutildir["logo.png"]
|
Invoke-WebRequest -Uri "https://christitus.com/images/logo-full.png" -OutFile $winutildir["logo.png"]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-NOT (Test-Path -Path $winutildir["logo.ico"])) {
|
if (-NOT (Test-Path -Path $winutildir["logo.ico"])) {
|
||||||
ConvertTo-Icon -bitmapPath $winutildir["logo.png"] -iconPath $winutildir["logo.ico"]
|
ConvertTo-Icon -bitmapPath $winutildir["logo.png"] -iconPath $winutildir["logo.ico"]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user