Skip to content

Commit

Permalink
Avoid use of New-TemporaryFile cmdlet for PowerShell 7 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
brogers5 committed Aug 6, 2024
1 parent cf1d75d commit 73ddc3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $settingsFilePath = Join-Path -Path $unzipLocation -ChildPath 'settings.json'

$pp = Get-PackageParameters
$shouldRestoreSettings = $false
$tempSettingsFilePath = New-TemporaryFile
$tempSettingsFilePath = Get-Item -Path ([System.IO.Path]::GetTempFilename())
$shouldCleanUpLegacySettingsFile = $false
if ((Test-Path -Path $settingsFilePath) -and !$pp.DontPersistSettings) {
Copy-Item -Path $settingsFilePath -Destination $tempSettingsFilePath -Force
Expand Down

0 comments on commit 73ddc3b

Please sign in to comment.