File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 154
154
155
155
# Set the location where to save the diskpart command
156
156
$diskpartScriptFile = Get-PSFConfigValue - FullName psdatabaseclone.diskpart.scriptfile - Fallback " $env: APPDATA \psdatabaseclone\diskpartcommand.txt"
157
+
158
+ if (-not (Test-Path - Path $diskpartScriptFile )){
159
+ try {
160
+ $null = New-Item - Path $diskpartScriptFile - ItemType File
161
+ }
162
+ catch {
163
+ Stop-PSFFunction - Message " Could not create diskpart script file" - ErrorRecord $_ - Continue
164
+ }
165
+ }
157
166
}
158
167
159
168
process {
Original file line number Diff line number Diff line change 164
164
165
165
# Set the location where to save the diskpart command
166
166
$diskpartScriptFile = Get-PSFConfigValue - FullName psdatabaseclone.diskpart.scriptfile - Fallback " $env: APPDATA \psdatabaseclone\diskpartcommand.txt"
167
+
168
+ if (-not (Test-Path - Path $diskpartScriptFile )){
169
+ try {
170
+ $null = New-Item - Path $diskpartScriptFile - ItemType File
171
+ }
172
+ catch {
173
+ Stop-PSFFunction - Message " Could not create diskpart script file" - ErrorRecord $_ - Continue
174
+ }
175
+ }
167
176
}
168
177
169
178
process {
Original file line number Diff line number Diff line change 390
390
391
391
# Set the path to the diskpart script file
392
392
Set-PSFConfig - Module PSDatabaseClone - Name diskpart.scriptfile - Value " $env: APPDATA \psdatabaseclone\diskpartcommand.txt" - Validation string
393
+ New-Item - Path " $env: APPDATA \psdatabaseclone" - ItemType Directory
393
394
Get-PSFConfig - FullName psdatabaseclone.diskpart.scriptfile | Register-PSFConfig - Scope SystemDefault
394
395
395
396
# Check if all the settings have been made
You can’t perform that action at this time.
0 commit comments