mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-07-18 01:40:49 +00:00
Cleanup start.ps1 (#4587)
* Update start.ps1 * Update start.ps1 * Update start.ps1 * Update start.ps1 * Update start.ps1 * Update start.ps1 * Update start.ps1 * Update start.ps1 * Update start.ps1 * Fix startup logging regression --------- Co-authored-by: Chris Titus <contact@christitus.com>
This commit is contained in:
@@ -55,13 +55,8 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
# Load DLLs
|
|
||||||
Add-Type -AssemblyName PresentationFramework
|
|
||||||
Add-Type -AssemblyName System.Windows.Forms
|
|
||||||
|
|
||||||
# Variable to sync between runspaces
|
# Variable to sync between runspaces
|
||||||
$sync = [Hashtable]::Synchronized(@{})
|
$sync = [Hashtable]::Synchronized(@{})
|
||||||
$sync.PSScriptRoot = $PSScriptRoot
|
|
||||||
$sync.version = "#{replaceme}"
|
$sync.version = "#{replaceme}"
|
||||||
$sync.configs = @{}
|
$sync.configs = @{}
|
||||||
$sync.Buttons = [System.Collections.Generic.List[PSObject]]::new()
|
$sync.Buttons = [System.Collections.Generic.List[PSObject]]::new()
|
||||||
@@ -73,22 +68,15 @@ $sync.selectedTweaks = [System.Collections.Generic.List[string]]::new()
|
|||||||
$sync.selectedToggles = [System.Collections.Generic.List[string]]::new()
|
$sync.selectedToggles = [System.Collections.Generic.List[string]]::new()
|
||||||
$sync.selectedFeatures = [System.Collections.Generic.List[string]]::new()
|
$sync.selectedFeatures = [System.Collections.Generic.List[string]]::new()
|
||||||
$sync.currentTab = "Install"
|
$sync.currentTab = "Install"
|
||||||
$sync.selectedAppsStackPanel
|
|
||||||
$sync.selectedAppsPopup
|
|
||||||
|
|
||||||
$dateTime = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"
|
$dateTime = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"
|
||||||
|
|
||||||
# Set the path for the winutil directory
|
|
||||||
$winutildir = "$env:LocalAppData\winutil"
|
$winutildir = "$env:LocalAppData\winutil"
|
||||||
New-Item $winutildir -ItemType Directory -Force | Out-Null
|
|
||||||
$sync.winutildir = $winutildir
|
$sync.winutildir = $winutildir
|
||||||
|
|
||||||
$logdir = "$winutildir\logs"
|
$logdir = "$winutildir\logs"
|
||||||
New-Item $logdir -ItemType Directory -Force | Out-Null
|
|
||||||
$sync.logPath = "$logdir\winutil_$dateTime.log"
|
$sync.logPath = "$logdir\winutil_$dateTime.log"
|
||||||
$sync.transcriptPath = $sync.logPath
|
$sync.transcriptPath = $sync.logPath
|
||||||
Start-Transcript -Path $sync.logPath -Append -NoClobber | Out-Null
|
Start-Transcript -Path $sync.logPath -Append -NoClobber | Out-Null
|
||||||
|
|
||||||
# Set PowerShell window title
|
$Host.UI.RawUI.WindowTitle = "WinUtil"
|
||||||
$Host.UI.RawUI.WindowTitle = "WinUtil (Admin)"
|
Clear-Host
|
||||||
clear-host
|
|
||||||
|
|||||||
Reference in New Issue
Block a user