Skip to content

Commit

Permalink
use .net method to get temp path
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnypolley authored Oct 9, 2024
1 parent 619041e commit 63513de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Tests/TestUtils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function Mock-Api-Call-Grails-1.1.1-Available($Available) {
function Mock-PSDK-Dir {
$Script:backup_PSDK_DIR = $Global:PSDK_DIR
$randomName = (-join ((65..90) + (97..122) | Get-Random -Count 5 | % {[char]$_}))

Check warning

Code scanning / PSScriptAnalyzer

'%' is an alias of 'ForEach-Object'. Alias can introduce possible problems and make scripts hard to maintain. Please consider changing alias to its full content. Warning

'%' is an alias of 'ForEach-Object'. Alias can introduce possible problems and make scripts hard to maintain. Please consider changing alias to its full content.
$testPath = "$env:Temp\$randomName"
$tempDir = [System.IO.Path]::GetTempPath()
$testPath = "$tempDir\$randomName"
New-Item -ItemType Directory "$testPath\.posh-sdk" | Out-Null
$Global:PSDK_DIR = (Get-Item "$testPath\.posh-sdk").FullName

Check warning

Code scanning / PSScriptAnalyzer

Found global variable 'Global:PSDK_DIR'. Warning

Found global variable 'Global:PSDK_DIR'.
New-Item -ItemType Directory "$Global:PSDK_DIR\grails" | Out-Null
Expand Down

0 comments on commit 63513de

Please sign in to comment.