From 9307c2db4932aa4c757db52e8c848d6ee08da1be Mon Sep 17 00:00:00 2001 From: mrrfv Date: Sat, 9 Mar 2024 17:32:56 +0100 Subject: [PATCH] cd into the script location on Windows Fixes #108 --- backup-windows.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backup-windows.ps1 b/backup-windows.ps1 index 8d559a1..ca23050 100644 --- a/backup-windows.ps1 +++ b/backup-windows.ps1 @@ -7,6 +7,8 @@ Write-Output "Warning: WSL 2 is required. WSL will be updated to fix potential i Write-Output "For more information, see here: https://github.com/microsoft/wslg#install-instructions-existing-wsl-install" Write-Output "" pause +# Corrects the cwd if it's different than the script directory +Set-Location -Path $PSScriptRoot Write-Output "Updating WSL..." wsl --update wsl --shutdown