-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
. ".\utils.ps1" | ||
|
||
$FloppyFolder = "./floppy" | ||
if (-not (Test-Path "${FloppyFolder}")) { | ||
New-Item -Path "${FloppyFolder}" -ItemType "directory" | ||
} | ||
|
||
while ($true) { | ||
while ($true) { | ||
$Name = Read-Host "Please insert a new floppy and give a name for it" | ||
$FloppyPath = "${FloppyFolder}\${Name}" | ||
if (Test-Path "${FloppyPath}") { | ||
Show-Output "This folder already exists. Please use another name." | ||
} elseif (Test-Path "${Name}" -IsValid) { | ||
break | ||
} else { | ||
Show-Output "Invalid name. Please don't use special characters etc." | ||
} | ||
} | ||
|
||
Show-Output "Copying the floppy." | ||
Copy-Item -Path "A:\" -Destination "${FloppyPath}" -Recurse | ||
if (-not $?) { | ||
Show-Output "Copying the floppy failed. Please check the output folder to see which files were copied." | ||
continue | ||
} | ||
|
||
# $Format = Get-YesNo -Question "Floppy copied. Do you want to format the floppy?" | ||
# if ($Format) { | ||
# Format-Volume -DriveLetter "A" -FileSystem "FAT" -Full -Force | ||
# } | ||
# Show-Output "Floppy formatted. Please remove the floppy." | ||
Show-Output "Floppy copied. Please remove the floppy." | ||
} |