Skip to content

Commit

Permalink
fix errors caused by missing account files on disk during module load (
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbolger committed Nov 19, 2024
1 parent 12dc664 commit 88583ca
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Posh-ACME/Private/Import-PAConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,19 @@ function Import-PAConfig {

$script:Acct = Get-PAAccount -ID $acctID

$ImportOrder = $true
if ($script:Acct) {
$ImportOrder = $true
} else {
Write-Warning "Unable to locate current account $acctID"
$script:Order = $null
}
} else {
# wipe references since we have no current account
$script:Acct = $null
$script:Order = $null
}

if ($script:Acct) {
# Check for a v3 plugindata.xml file and convert it to order-specific v4
# files.
$pDataV3File = Join-Path $script:Acct.Folder 'plugindata.xml'
Expand All @@ -104,11 +115,6 @@ function Import-PAConfig {

Move-Item $pDataV3File (Join-Path $script:Acct.Folder 'plugindata.xml.v3') -Force
}

} else {
# wipe references since we have no current account
$script:Acct = $null
$script:Order = $null
}
}

Expand Down

0 comments on commit 88583ca

Please sign in to comment.