From ff09e39343198daed36869dbe016074bb3539a8f Mon Sep 17 00:00:00 2001 From: ThioJoe <12518330+ThioJoe@users.noreply.github.com> Date: Sun, 10 Aug 2025 16:32:54 -0400 Subject: [PATCH] Fix $LogDirectory variable in MS Store installer Addresses #4 --- Installer Scripts/Install-Microsoft-Store.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Installer Scripts/Install-Microsoft-Store.ps1 b/Installer Scripts/Install-Microsoft-Store.ps1 index 8e45c78..2624dc9 100644 --- a/Installer Scripts/Install-Microsoft-Store.ps1 +++ b/Installer Scripts/Install-Microsoft-Store.ps1 @@ -4,7 +4,7 @@ # Author: ThioJoe # Repo Url: https://github.com/ThioJoe/Windows-Sandbox-Tools -# Last Updated: August 6, 2025 +# Last Updated: August 10, 2025 param( # Optional switch to output the generated XML files to the working directory @@ -45,6 +45,7 @@ $storeCategoryId = "64293252-5926-453c-9494-2d4021f1c78d" # Combine them to create the full working directory path $workingDir = Join-Path -Path $userDownloadsFolder -ChildPath $subfolderName +$LogDirectory = Join-Path -Path $workingDir -ChildPath "Logs" # Create the directory if it doesn't exist if (-not (Test-Path -Path $workingDir)) { @@ -52,7 +53,11 @@ if (-not (Test-Path -Path $workingDir)) { } If ($debugSaveFiles) { - Write-Host "All files (logs, downloads) will be saved to: '$workingDir'" -ForegroundColor Yellow + # Create a subdirectory for logs if it doesn't exist + if (-not (Test-Path -Path $LogDirectory)) { + New-Item -Path $LogDirectory -ItemType Directory -Force | Out-Null + } + Write-Host "All files (logs, downloads) will be saved to: '$LogDirectory'" -ForegroundColor Yellow } # --- XML Templates ---