mirror of
https://github.com/ntdevlabs/tiny11builder.git
synced 2024-11-24 04:45:30 +00:00
Update tiny11maker.ps1 - error handling param
error handling for param as we will later make the script agnostic to execution on OSDrive / $env:systemdrive
This commit is contained in:
parent
a5a4d97994
commit
5ca27c740e
@ -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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user