mirror of
https://github.com/ntdevlabs/tiny11builder.git
synced 2025-12-18 01:14:13 +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
1 changed files with 11 additions and 3 deletions
|
|
@ -29,11 +29,19 @@ if (! $myWindowsPrincipal.IsInRole($adminRole))
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
param ($ScratchDisk)
|
param (
|
||||||
if ($Null -eq $ScratchDisk) {
|
[ValidatePattern('^[c-zC-Z]$')]
|
||||||
$ScratchDisk = $env:SystemDrive
|
[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 the transcript and prepare the window
|
||||||
Start-Transcript -Path "$PSScriptRoot\tiny11.log"
|
Start-Transcript -Path "$PSScriptRoot\tiny11.log"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue