diff --git a/tiny11maker.ps1 b/tiny11maker.ps1 index 64f215b..fe01824 100644 --- a/tiny11maker.ps1 +++ b/tiny11maker.ps1 @@ -29,11 +29,19 @@ if (! $myWindowsPrincipal.IsInRole($adminRole)) exit } -param ($ScratchDisk) -if ($Null -eq $ScratchDisk) { - $ScratchDisk = $env:SystemDrive +param ( + [ValidatePattern('^[c-zC-Z]$')] + [string]$ScratchDisk +) + +if (-not $ScratchDisk) { + $ScratchDisk = $PSScriptRoot -replace '[\\]+$', '' +} else { + $ScratchDisk = $ScratchDisk + ":" } +Write-Output "Scratch disk set to $ScratchDisk" + # Start the transcript and prepare the window Start-Transcript -Path "$PSScriptRoot\tiny11.log"