Skip to content

Commit 8e6c4bf

Browse files
committed
Fixed Get-PSDrive call
1 parent 9783a87 commit 8e6c4bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/scripts/postimport.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ if([bool](Get-PSFConfigValue -FullName psdatabaseclone.informationstore.mode) -e
3535
$jsonCred = Get-PSFConfigValue -FullName psdatabaseclone.informationstore.credential
3636

3737
# Create a PS Drive
38-
if (-not [bool](Get-PSDrive -Name PSDCJSONFolder -Scope Global)) {
38+
if (-not [bool](Get-PSDrive -Name PSDCJSONFolder -Scope Global -ErrorAction SilentlyContinue)) {
3939
try {
4040
$null = New-PSDrive -Name PSDCJSONFolder -Root $jsonFolder -Credential $jsonCred -PSProvider FileSystem -Scope Global
41+
Start-Sleep -Seconds 1
4142
}
4243
catch {
4344
Stop-PSFFunction -Message "Couldn't create PS Drive" -Target $jsonFolder -ErrorRecord $_

0 commit comments

Comments
 (0)