Improve handling of wmic output

This commit is contained in:
Manuel Thalmann 2024-07-29 01:22:42 +02:00
parent a7595096ba
commit 40fefb9f36

View file

@ -1,3 +1,2 @@
$drives = & wmic volume get "DriveLetter,Label"; $env:SETUP_DRIVE = (ConvertFrom-Csv ((wmic volume where "Label='$env:SETUP_LABEL'" get DriveLetter) | ForEach-Object { "$_".Trim(); })).DriveLetter;
$env:SETUP_DRIVE = $($($drives | Select-String -Pattern "$env:SETUP_LABEL") -split "\s+")[0];
Set-Location (Join-Path $env:SETUP_DRIVE $env:LOCAL_PROJECT_PATH) Set-Location (Join-Path $env:SETUP_DRIVE $env:LOCAL_PROJECT_PATH)