Skip to content

Commit

Permalink
Merge pull request #14 from sanderstad/development
Browse files Browse the repository at this point in the history
Fixed bugs in APPDATA folde usage
  • Loading branch information
sanderstad authored Sep 1, 2018
2 parents fe0a623 + 10f1733 commit e7ec7f2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions functions/clone/New-PSDCClone.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@

# Set the location where to save the diskpart command
$diskpartScriptFile = Get-PSFConfigValue -FullName psdatabaseclone.diskpart.scriptfile -Fallback "$env:APPDATA\psdatabaseclone\diskpartcommand.txt"

if(-not (Test-Path -Path $diskpartScriptFile)){
try{
$null = New-Item -Path $diskpartScriptFile -ItemType File
}
catch{
Stop-PSFFunction -Message "Could not create diskpart script file" -ErrorRecord $_ -Continue
}
}
}

process {
Expand Down
9 changes: 9 additions & 0 deletions functions/disk/New-PSDCVhdDisk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@

# Set the location where to save the diskpart command
$diskpartScriptFile = Get-PSFConfigValue -FullName psdatabaseclone.diskpart.scriptfile -Fallback "$env:APPDATA\psdatabaseclone\diskpartcommand.txt"

if(-not (Test-Path -Path $diskpartScriptFile)){
try{
$null = New-Item -Path $diskpartScriptFile -ItemType File
}
catch{
Stop-PSFFunction -Message "Could not create diskpart script file" -ErrorRecord $_ -Continue
}
}
}

process {
Expand Down
1 change: 1 addition & 0 deletions functions/support/Set-PSDCConfiguration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@

# Set the path to the diskpart script file
Set-PSFConfig -Module PSDatabaseClone -Name diskpart.scriptfile -Value "$env:APPDATA\psdatabaseclone\diskpartcommand.txt" -Validation string
New-Item -Path "$env:APPDATA\psdatabaseclone" -ItemType Directory
Get-PSFConfig -FullName psdatabaseclone.diskpart.scriptfile | Register-PSFConfig -Scope SystemDefault

# Check if all the settings have been made
Expand Down

0 comments on commit e7ec7f2

Please sign in to comment.