mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-05-23 15:57:24 -05:00
Tidy up preference file changes
This commit is contained in:
parent
20769f66a1
commit
963c0a17aa
@ -24,18 +24,16 @@ function Set-PackageManagerPreference {
|
||||
$preferedPackageManager = [PackageManagers]::Choco
|
||||
Remove-Item -Path $oldChocoPath
|
||||
}
|
||||
else {
|
||||
elseif (Test-Path -Path $preferencePath) {
|
||||
$potential = Get-Content -Path $preferencePath -TotalCount 1
|
||||
if ($potential)
|
||||
{$preferedPackageManager = [PackageManagers]$potential}
|
||||
$preferedPackageManager = [PackageManagers]$potential
|
||||
}
|
||||
else {
|
||||
Write-Debug "Creating new preference file, defaulting to winget."
|
||||
$preferedPackageManager = [PackageManagers]::Winget
|
||||
}
|
||||
}
|
||||
|
||||
#If no preference argument, .ini file bad read, and $sync empty then default to winget.
|
||||
if ($null -eq $preferedPackageManager -and $null -eq $sync["ManagerPreference"])
|
||||
{ $preferedPackageManager = [PackageManagers]::Winget }
|
||||
|
||||
|
||||
$sync["ManagerPreference"] = [PackageManagers]::$preferedPackageManager
|
||||
Write-Debug "Manager Preference changed to '$($sync["ManagerPreference"])'"
|
||||
|
||||
|
@ -219,7 +219,7 @@ function Update-AppTileProperties {
|
||||
$sync.Form.Resources.AppTileMargins = [Windows.Thickness]2
|
||||
$sync.Form.Resources.AppTileBorderThickness = [Windows.Thickness]0
|
||||
}
|
||||
else {
|
||||
else {
|
||||
# On first load, set the AppTileWidth to NaN because the Window dosnt exist yet and there is no ActuaWidth
|
||||
if ($sync.ItemsControl.ActualWidth -gt 0) {
|
||||
$sync.Form.Resources.AppTileWidth = $sync.ItemsControl.ActualWidth -20}
|
||||
|
Loading…
x
Reference in New Issue
Block a user