Skip to content

Commit

Permalink
Trying to fix Get-GitHubGist/Download.Error test
Browse files Browse the repository at this point in the history
  • Loading branch information
HowardWolosky committed Jul 20, 2020
1 parent 94a3daf commit b3fe2a5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,14 @@ function New-TemporaryDirectory
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")]
param()

$guid = [System.GUID]::NewGuid()
while (Test-Path -PathType Container (Join-Path -Path $env:TEMP -ChildPath $guid))
$parentTempPath = [System.IO.Path]::GetTempPath()
$tempFolderPath = [String]::Empty
do
{
$guid = [System.GUID]::NewGuid()
$guid = [System.Guid]::NewGuid()
$tempFolderPath = Join-Path -Path $parentTempPath -ChildPath $guid
}

$tempFolderPath = Join-Path -Path $env:TEMP -ChildPath $guid
while (Test-Path -Path $tempFolderPath -PathType Container)

Write-Log -Message "Creating temporary directory: $tempFolderPath" -Level Verbose
New-Item -ItemType Directory -Path $tempFolderPath
Expand Down

0 comments on commit b3fe2a5

Please sign in to comment.