|
|
@@ -1,6 +1,7 @@
|
|
|
|
|
|
Add-Type -AssemblyName "System.Windows.Forms"
|
|
|
|
|
|
+Import-Module -Name ($PSScriptRoot + "/lib/forms.psm1")
|
|
|
$PSScriptRoot |Out-Host
|
|
|
|
|
|
Function BecomeAdmin($script){
|
|
|
@@ -18,17 +19,6 @@ Function LogFilePath($name){
|
|
|
[System.IO.Path]::Combine($PSScriptRoot, "log", $logfilename)
|
|
|
}
|
|
|
|
|
|
-Function GuiMessageBox
|
|
|
-{
|
|
|
- param(
|
|
|
- $text,
|
|
|
- $title = "Continue",
|
|
|
- $buttons = "YesNo",
|
|
|
- $level = "Info"
|
|
|
- )
|
|
|
- [System.Windows.Forms.MessageBox]::Show($text, $title, $buttons, $level)
|
|
|
-}
|
|
|
-
|
|
|
Function WinDD($inFileName, $outFileName, $bs = 5Mb, $create = $false) {
|
|
|
|
|
|
Write-Output ""
|
|
|
@@ -96,7 +86,7 @@ Function WinDD($inFileName, $outFileName, $bs = 5Mb, $create = $false) {
|
|
|
|
|
|
} #end function WinDD
|
|
|
|
|
|
-Function Reset-Disk($disknum)
|
|
|
+Function Reset-Disk($disknum, $parttabletype="MBR")
|
|
|
{
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
|
|
@@ -108,10 +98,10 @@ list disk
|
|
|
select disk $disknum
|
|
|
list partition
|
|
|
clean
|
|
|
+convert $parttabletype
|
|
|
+create partition primary
|
|
|
"@ | diskpart
|
|
|
|
|
|
- Write-Output "Sleeping 10s to make sure drive is available..."
|
|
|
- sleep 10
|
|
|
}
|
|
|
|
|
|
Function FixCHS($disknum){
|
|
|
@@ -292,4 +282,3 @@ function Hide-Console
|
|
|
[Console.Window]::ShowWindow($consolePtr, 0)
|
|
|
}
|
|
|
|
|
|
-Export-ModuleMember -Function *
|