|
1 | 1 | function Start-FastCopy {
|
2 | 2 | <#
|
3 | 3 | .SYNOPSIS
|
4 | | - |
5 | | - Initiates a batch copy operation using FastCopy, with per-folder transfer, |
6 | | - speed control, verification, and optional delay. |
| 4 | + Initiates a batch copy operation using FastCopy, with per-folder transfer, |
| 5 | + speed control, verification, and optional delay. |
7 | 6 |
|
8 | 7 | .DESCRIPTION
|
9 | 8 |
|
10 | | - This function performs controlled copying of each subfolder from a specified |
11 | | - source directory to a target directory using the external FastCopy utility. |
| 9 | + This function performs controlled copying of each subfolder from a specified |
| 10 | + source directory to a target directory using the external FastCopy utility. |
12 | 11 |
|
13 | | - Features include: |
14 | | - - Transfer speed configuration ("full", "autoslow", "suspend", or custom 1–9) |
15 | | - - Optional file verification after transfer |
16 | | - - Dry run simulation with windowed FastCopy execution |
17 | | - - Optional delay between subfolder copies for thermal throttling |
18 | | - - Interactive confirmation via PowerShell's ShouldProcess |
19 | | - - Setup FastCopy executable path in a config file instead of digging inside the code |
| 12 | + Features include: |
| 13 | + - Transfer speed configuration ("full", "autoslow", "suspend", or custom 1–9) |
| 14 | + - Optional file verification after transfer |
| 15 | + - Dry run simulation with windowed FastCopy execution |
| 16 | + - Optional delay between subfolder copies for thermal throttling |
| 17 | + - Interactive confirmation via PowerShell's ShouldProcess |
| 18 | + - Setup FastCopy executable path in a config file instead of digging inside the code |
20 | 19 |
|
21 | 20 | .PARAMETER sourceFolderPath
|
22 | | - |
23 | | - The root source directory. Each immediate subfolder will be copied individually. |
24 | | - |
25 | | - Alias: SourceFolder |
| 21 | + The root source directory. Each immediate subfolder will be copied individually. |
| 22 | + Alias: SourceFolder |
26 | 23 |
|
27 | 24 | .PARAMETER targetFolderPath
|
28 | | - |
29 | | - The root destination directory. Each subfolder will be copied as a new folder here. |
30 | | - |
31 | | - Alias: TargetFolder |
| 25 | + The root destination directory. Each subfolder will be copied as a new folder here. |
| 26 | + Alias: TargetFolder |
32 | 27 |
|
33 | 28 | .PARAMETER fastCopyPath
|
34 | | - |
35 | | - Optional override of the default and configured path to FastCopy.exe executable, |
36 | | - useful when using portable FastCopy.exe. |
| 29 | + Optional override of the default and configured path to FastCopy.exe executable, |
| 30 | + useful when using portable FastCopy.exe. |
37 | 31 |
|
38 | 32 | .PARAMETER strMode
|
39 | | - |
40 | | - Speed mode to use. Acceptable values: full, autoslow, suspend, custom. |
41 | | - When 'custom' is selected, -intSpeed must be specified. |
42 | | - |
43 | | - Alias: Mode |
| 33 | + Speed mode to use. Acceptable values: full, autoslow, suspend, custom. |
| 34 | + When 'custom' is selected, -intSpeed must be specified. |
| 35 | + Alias: Mode |
44 | 36 |
|
45 | 37 | .PARAMETER intSpeed
|
46 | | - |
47 | | - Custom integer transfer speed (1–9). Only required when -strMode is 'custom'. |
48 | | - |
49 | | - Alias: Speed |
| 38 | + Custom integer transfer speed (1–9). Only required when -strMode is 'custom'. |
| 39 | + Alias: Speed |
50 | 40 |
|
51 | 41 | .PARAMETER delaySeconds
|
52 | | - |
53 | | - Optional delay (in seconds) to wait between copying each subfolder. |
54 | | - |
55 | | - Alias: Delay |
| 42 | + Optional delay (in seconds) to wait between copying each subfolder. |
| 43 | + Alias: Delay |
56 | 44 |
|
57 | 45 | .PARAMETER verifyDigit
|
58 | | - |
59 | | - 1 to enable post-copy verification (default), 0 to disable. |
60 | | - |
61 | | - Alias: Verify |
| 46 | + 1 to enable post-copy verification (default), 0 to disable. |
| 47 | + Alias: Verify |
62 | 48 |
|
63 | 49 | .PARAMETER execDigit
|
64 | | - |
65 | | - 1 to execute FastCopy (default), 0 to simulate using /no_exec. |
66 | | - |
67 | | - Alias: Exec |
| 50 | + 1 to execute FastCopy (default), 0 to simulate using /no_exec. |
| 51 | + Alias: Exec |
68 | 52 |
|
69 | 53 | .INPUTS
|
70 | | - |
71 | | - Accepts parameters for source and target folder paths, FastCopy executable path, |
72 | | - mode, speed, delay, verification, and execution flags. For details, check the |
73 | | - parameter descriptions. |
| 54 | + Accepts parameters for source and target folder paths, FastCopy executable path, |
| 55 | + mode, speed, delay, verification, and execution flags. For details, check the |
| 56 | + parameter descriptions. |
74 | 57 |
|
75 | 58 | .OUTPUTS
|
76 | | - |
77 | | - None. Writes progress and status messages to host. |
| 59 | + None. Writes progress and status messages to host. |
78 | 60 |
|
79 | 61 | .EXAMPLE
|
80 | | - |
81 | | - Start-FastCopy -SourceFolder "D:\Data" -TargetFolder "G:\Backup" ` |
82 | | - -Mode "custom" -Speed 5 -Delay 60 -Verify 1 -Exec 1 |
| 62 | + Start-FastCopy -SourceFolder "D:\Data" -TargetFolder "G:\Backup" ` |
| 63 | + -Mode "custom" -Speed 5 -Delay 60 -Verify 1 -Exec 1 |
83 | 64 |
|
84 | 65 | .NOTES
|
| 66 | + This function is the main function for the FastCopyTools module. |
| 67 | + Users should dot source this script to load the module and its dependencies. |
85 | 68 |
|
86 | | - This function is the main function for the FastCopyTools module. |
87 | | - Users should dot source this script to load the module and its dependencies. |
| 69 | + Author: Jialiang Chang |
| 70 | + Version: 1.0 |
| 71 | + Date: 2025年05月27日 |
88 | 72 |
|
89 | | - Author: Jialiang Chang |
90 | | - Version: 1.0 |
91 | | - Date: 2025年05月27日 |
92 | 73 | #>
|
93 | 74 |
|
94 | | - |
95 | 75 | [CmdletBinding(
|
96 | 76 | SupportsShouldProcess = $true,
|
97 | 77 | ConfirmImpact = 'High',
|
|
0 commit comments